title: Eloquent - Get latest date and insert the result to another table
body: <p>We have 2 tables</p>
  
  <p><strong>Titles</strong></p>
  
  <pre><code>+------+--------------------------------------+--------------+---------------------+
  | id   | title                                | subs_updated | created_at          |
  +------+--------------------------------------+--------------+---------------------+
  |  104 | movie 1                              |              | 2014-11-11 12:08:28 |
  |  129 | movie 2                              |              | 2014-11-11 12:08:29 |
  +------+--------------------------------------+--------------+---------------------+
  </code></pre>
  
  <p><strong>Subs</strong></p>
  
  <pre><code>+----+----------+----------+---------+---------------------+
  | id |  label   | title_id | subs    | created_at          |
  +----+----------+----------+---------+---------------------+
  | 13 | English  |      104 | English | 2014-11-12 05:05:39 |
  | 15 | Italian  |      104 | Italian | 2014-11-12 05:25:00 |
  | 16 | Dutch    |      104 | Dutch   | 2014-11-13 05:40:51 |
  | 18 | Arabic   |      129 | Arabic  | 2014-11-12 06:05:28 |
  | 19 | Arabic   |      129 | Arabic  | 2014-11-12 06:07:23 |
  +----+----------+----------+---------+---------------------+
  </code></pre>
  
  <p><strong>In the SubsController i have :</strong></p>
  
  <pre><code>public function attach()
  {
      $input = Input::except('_token');
  
      if ( ! Input::get('label') || ! Input::get('subs')) {
          return Response::json(trans('subs::main.fillAllRequiredFields'), 400);
      }
  
      if ( ! isset($input['title_id']))
      {
          return Response::json(trans('dash.somethingWrong'), 500);
      }
  
      else
      {
          $this-&gt;model-&gt;fill($input)-&gt;save();
      }
  
      return Response::json($this-&gt;model, 201);
  }
  </code></pre>
  
  <p><br></p>
  
  <p><strong>Subs Model</strong></p>
  
  <pre><code>&lt;?php
  
  class Link extends Entity {
  
      public $table = 'subs';
  
      protected $guarded = array('id');
  
      public function title()
      {
          return $this-&gt;belongsTo('Title');
      }
  }
  </code></pre>
  
  <ol>
  <li>I want to find the latest sub by created date (created_at) for a title (title_id) in subs table.</li>
  <li>Insert that result (date) to titles table => title (id) => subs_updated</li>
  <li>Use that query along with the above attach() function</li>
  </ol>
  
  <p><br>
  Any help is really appreciated</p>