title: laravel 5 reletionship hasMany on two columns
body: <p>I'm trying to implement relationship on two columns, record_id and table_name, </p>
  
  <p>here is what I got so far, Model name BatteryAssets: </p>
  
  <pre><code>public function Attachments()
      {
         return $this-&gt;hasMany('App\Attachments','record_id','id')-&gt;where('tabel_name','`battery_assets`');
      }
  </code></pre>
  
  <p>please note that 'battery_asstes' is a string, so it's not dynamic, I'm trying to make it as a string, but get the following error : </p>
  
  <pre><code>QueryException in Connection.php line 761:
  SQLSTATE[42S22]: Column not found: 1054 Unknown column 'tabel_name' in 'where clause' (SQL: select * from `attachments` where `attachments`.`record_id` = 1 and `attachments`.`record_id` is not null and `tabel_name` = `battery_assets`)
  </code></pre>
  
  <p>as you see I'm I have tried to put battery_assets into `` and also I've tried to put them into double quotes ' "battery_assets" ' and also no quotes</p>
  
  <p>and also please not that BatteryAssets table does not have table_name column, I'm only want to use it as a static value in the where clause, also I've tryied to do </p>
  
  <pre><code>-&gt;where('attachments.tabel_name','"battery_assets"');
  </code></pre>
  
  <p>but It gives the same error</p>