title: how i can avoid this error getClientOriginalExtension() on null
body: <p><strong>ERROR</strong></p>
  <p>Symfony\Component\Debug\Exception\FatalThrowableError thrown with message &quot;Call to a member function getClientOriginalExtension() on null&quot;</p>
  <p>Stacktrace:</p>
  <h1>0 Symfony\Component\Debug\Exception\FatalThrowableError in MYPATH\app\Http\Controllers\PostsController.php:66</h1>
  <p><strong>Controller</strong></p>
  <pre><code>public function store(Request $request)
    {
      
      $this-&gt;validate(request(),[
  
          'title' =&gt; 'required',
  
          'image' =&gt; 'image|mimes:jpeg,png,jpg,gif,svg',
  
          'body' =&gt; 'required',
  
      ]);
  
      $imageName = time().'.'.$request-&gt;image_file-&gt;getClientOriginalExtension();
      $request-&gt;image-&gt;move(public_path('image'), $imageName);
  
      auth()-&gt;user()-&gt;publish(
  
          new Post(request(['title','body']))
      );
  
      
      session()-&gt;flash('message', 'your post has now been published');
  
      
      return redirect('/');
  }
  </code></pre>