Use Intervention package to upload image
composer require https://github.com/Intervention/image
and here is my controller query i have used in my project
public function updateprofile(Request $request)
{
$name=str_random(30) . '-' . $request->file('image')->getClientOriginalName();
$request->file('image')->move('users',$name);
$user=new User;
$user->where('email', '=', Auth::user()->email)->update(['avatar' => 'users/'.$name]);
return Redirect::to('user_profile');
}
maybe it will helpful!!
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community