Laravel acces file upload
Hi,
I've successfully uploaded an image like this:
Storage::put($path,$request->file($name));
But how could I acces this right now? The file is in storage/app/employees/3/profile.
When I go to .dev/storage/app/employees/3/profile/image.png the route is not found.
Depending what you mean by 'access', you could do things like :
YourController:
public function getImage($id)
{
$image = Image::findOrFail($id);
return response()->file($image->path);
}
YourView:
<img src="{{{ action('YourController@getImage', $image->id) }}}">
@ohffs and how could I access this with an api?
Please or to participate in this conversation.