Call to a member function move() on null Laravel when file is existed

  file-upload, laravel, php

I got error with

Call to a member function move() on null at $request->file->move('storage/'. $filename);

enter image description here

 $application = new Application;
        if($request->file('proposal')){
            $file=$request->file('proposal');
            $filename=time().'.'.$file->getClientOriginalExtension();
            $request->file->move('storage/'. $filename);

            $application->file= $filename;
        }

<form class="form-horizontal" action="{{route('application.store')}}" enctype="multipart/form-data" method="POST">
........
 <input type="file" name="application_proposal">
</form

Source: Laravel

Leave a Reply