title: Upload Image and save image path to database Lavavel 5.4
body: <p>I am creating a new post on Laravel. But I stuck here to upload an image and save the image path to database. My controller is</p>
  
  <p>
  
  <pre><code>if($request-&gt;hasFile('image'))
          {
              $image = $request-&gt;file('image');
              $filename = time() . '.'. $image-&gt;getClientOriginalExtension();
  
              $path = public_path('images');
              $imagepath = $request-&gt;image-&gt;move($path, $filename);
              $post-&gt;image = $imagepath;
  
          }
  </code></pre>
  
  <p>But it saves path as 'C:\xampp\tmp\php2CF9.tmp'.
  What is causing the error? Or are there any better approaches than this?</p>