please create a symlink first
php artisan storage:link
then try this code to get
$file = public_path('storage/profile-photos/t5Kxo6R7IjspwImQNcwayPU4jG6fmYoS4r5kupIK.png');
Hopefully it will work. it will solve the problem
OUT TOPIC: (but important) How to store image perfectly (Try this code) first create symlink (if you already do then please skip)
php artisan storage:link
from form pass image field as (whatever you want) name = image
to controller write code
$fileOriginalName = $request->file('image')->getClientOriginalExtension();
$image = time() . $fileOriginalName;
$request->image->storeAs('image', $image, 'public');
from view show (please modify $data->value
to your variable and coloumn name)
<img src="{{asset('/storage/image/'.$data->value)}}" >
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community