I have following image tag in blade.
{!! Form::image('/MySplash/1/file.png', $alt="Photo", null) !!}
Below is my code in Route file..
Route::get('MySplash/{IconID}/{UniqueFileName}', function ($IconID, $filename)
{
$path = storage_path() . '/SplashScreenIcons/' . $IconID . '/' . $filename;
if(!File::exists($path)) {
abort(404);
}
$file = File::get($path);
$type = File::mimeType($path);
$response = Response::make($file, 200);
$response->header("Content-Type", $type);
return $response;;
});
Finally I get the image url like below.
http://localhost/SportsApp/public/MySplash/1/file.png
What's the problem
- It does not go into route.
- Url is showing public. whereas the image folder is in storage directory.
Am I missing anything?
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire