Support the ongoing development of Laravel.io →
Authentication Input
Last updated 2 years ago.
0

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!!
Last updated 8 years ago.
0

how do i put it on authcontroller?

thank you so much @techiva

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.