This solution works in the Public Folder more when switching to Storage folder I can not get the image and display in the view Can anyone help me?
Controller
public function profile(){
return view('profile', array('user' => Auth::user()) );
}
public function update_avatar(Request $request){
if($request->hasFile('avatar')){
$avatar = $request->file('avatar');
$filename = time() . '.' . $avatar->getClientOriginalExtension();
Image::make($avatar)->resize(300, 300)->save( storage_path('/uploads/avatars/' . $filename ) );
$user = Auth::user();
$user->avatar = $filename;
$user->save();
}
return view('profile', array('user' => Auth::user()) );
}
Route
Route::get('profile',
'UserController@profile');
Route::post('profile',
'UserController@update_avatar');
View This was the call I made to return the image when it was in the public folder now that this in the Storage folder does not work, does anyone know how I can get the image from the storage folder and display it in the view?
<img src="/uploads/avatars/{{ Auth::user()->avatar }}">
GitLab Repository link