public function getPhoto($photoId, $size = 'large')
    {
        $photo = Photo::findOrFail($photoId);

        switch ($size) {
            case 'large':
                return response()->download(storage_path().'/app/'.$photo->pathLarge);
            case 'small':
                return response()->download(storage_path().'/app/'.$photo->pathSmall);
        }

        abort(404);
    }
public function getPhoto($photoId, $size = 'large')
    {
        $photo = Photo::findOrFail($photoId);

        switch ($size) {
            case 'large':
                return response()->download(storage_path().'/app/'.$photo->pathLarge);
            case 'small':
                return response()->download(storage_path().'/app/'.$photo->pathSmall);
        }

        abort(404);
    }
public function getPhoto ( $ photoId , $ size = 'large' ) { $ photo = Photo :: findOrFail ( $ photoId ) ; switch ( $ size ) { case 'large' : return response ( ) -> download ( storage_path ( ) . '/app/' . $ photo -> pathLarge ) ; case 'small' : return response ( ) -> download ( storage_path ( ) . '/app/' . $ photo -> pathSmall ) ; } abort ( 404 ) ; }
Return a photo as a response.

@param int    $photoId
@param string $size

@return \Illuminate\Http\Response
Return a photo as a response .