You need to import it - at the top of your controller:
use Intervention\Image; // assuming Intervention!
class ...
this my code for uploading profile pic and it is my controller page code public function updateavatar(Request $request) { if ($request->hasFile('avatar')) { $avatar = $request->file('avatar'); $filename = time().'.'.$avatar->getClientOriginalExtension(); Image::make($avatar)->resize(300,300)->save(public_path('/uploads/avatars/'.$filename)); // dd($avatar);
} else {
# code...
}
and this is my view page
Upload your Image </form>
but when I run this code it gives me a error like Symfony \ Component \ Debug \ Exception \ FatalThrowableError (E_ERROR) Class 'App\Http\Controllers\Recruiter\Image' not found
How I can solve it help me in this code.
Please or to participate in this conversation.