i am trying to upload an image as a profile picture in laravel bootstrap auth package.
in this i am trying to change some package files to upload image. also i added a column in users table.
protected function create(array $data)
{
return User::create([
'name' => $data['name'],
'email' => $data['email'],
'password' => Hash::make($data['password']),
'campus_id' => $data['campus_id'],
'role' => $data['role'],
'remarks' => $data['remarks'],
'image' => $data['image'],
]);
}
i make changes in Auth controller in validation function
also makes some changes in user store function
2
Answers
I think you need to move user profile image before create its entry inside database.
You can use Image intervention for this. After installing you can use it in your controller as
use Image;
1st you need to move your image to your desired directory inside public folder and save that directory in the database.