Level 1
Anyone have any ideas on this??
So i have this image upload function
And i want to give a uploaded image the user->id but when i do
public function avatarupload($id) {
I get:
ErrorException in ProfilesController.php line 73:
Missing argument 1 for App\Http\Controllers\ProfilesController::avatarupload()
public function avatarupload($id = 1) {
$user = User::find($id);
$input = Input::all();
if (Input::hasFile('avatar')) {
$input = Input::all();
$fileName = 'avatar_'.$user->id;
$image = Image::make($input['avatar']->getRealPath());
$image->save(public_path() . '/upload/profile/avatars/'.$fileName)
->resize(300, null, function ($constraint) { $constraint->aspectRatio(); });
}
}
I have no clue to what to do here
Please or to participate in this conversation.