Call to a member function move() on null

Posted 1 week ago by irankhosravi

I want to upload an image with laravel 5.8

I use this codes

if (Input::file('image')) {  

And

if($request->has('image')) {

but it is not working. Call to a member function move() on null

    if($request->has('image')) {
        $image = $request->file('image');
        $filename = $image->getClientOriginalName();
        request()->$image->move(public_path('images/users'), $filename);
        $user->image = $request->file('image')->getClientOriginalName();
    }

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.