getAuthIdentifier() !== (int)$post->user_id) { throw new UnauthorizedHttpException('Cette image ne vous appartient pas.'); } $original = sprintf('%s/%s/%s', storage_path('app'), Auth::user()->getFolder(), $image); if ('o:full' === $options) { $img = $image_service->makeThumbnail($original); } else { $img = $image_service->makeThumbnail($original, ['width' => 300]); } return $img->response(File::extension($original)); } /** * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View */ public function gallery() { $posts_with_image = Post::where('user_id', Auth::user()->getAuthIdentifier()) ->where('image', '!=', 'null') ->orderBy('created_at', 'desc') ->paginate(30); return view('gallery.my', [ 'posts' => $posts_with_image, ]); } }