title: How to save image path into database in Laravel?
body: <p>I want to upload an image and retrieve in from database when i need this.My code is perfectly working to upload image but it's path did not save in database.In database it's showing <code>Null</code>.Here is my code:</p>
  
  <pre><code>    if ($request-&gt;hasFile('profilePic')) {
          $file = array('profilePic' =&gt; Input::file('profilePic'));
          $destinationPath = 'img/'; // upload path
          $extension = Input::file('profilePic')-&gt;getClientOriginalExtension(); 
          $fileName = rand(11111,99999).'.'.$extension; // renaming image
          Input::file('profilePic')-&gt;move($destinationPath, $fileName);
      }else{
          echo "Please Upload Your Profile Image!";
      }
      $profile-&gt;save();
  </code></pre>
  
  <p><strong>My Question:</strong>  </p>
  
  <ul>
  <li>How to save image path into database?  </li>
  <li>And how to retrieve image from database?</li>
  </ul>
  
  <p><strong>Updated: Profile.php</strong></p>
  
  <pre><code>class Profile extends Model
  {
      protected $table = "profiles";
      public $fillable = ["firstName","lastName","middleName","DOB","gender","featuredProfile","email","phone","summary","profilePic"];
  }
  </code></pre>