title: laravel relationship with 4 tables hasManyThrough
body: <p>I have the following table structure</p>
  <pre><code>type_devices-&gt;pivot(firms_type_devices)-&gt;firms-&gt;models
  </code></pre>
  <p>[<img src="https://i.stack.imgur.com/3WOOT.png" alt="Database Model" />]</p>
  <ol>
  <li><p><code>type_devices</code>  can have many <code>firms</code></p>
  </li>
  <li><p><code>firms</code> can have many <code>type_devices</code></p>
  </li>
  <li><p><code>firms</code> can have many <code>models</code></p>
  </li>
  <li><p><code>models</code> can have one <code>firm</code></p>
  </li>
  </ol>
  <p>Table <code>model</code> have field -&gt; <code>firms_id</code></p>
  <pre class="lang-php prettyprint-override"><code>class TypeDevices extends Model
  {
      use \Staudenmeir\EloquentHasManyDeep\HasRelationships;
      use SoftDeletes;
  
      protected $fillable = [
          'title_device',
          'slug',
      ];
  
      public function firms()
      {
          return $this-&gt;belongsToMany(Firms::class);
      }
  }
  </code></pre>
  <p>When I use <code>$result = $this-&gt;with('firms:id,title')-&gt;get();</code>
  I get a list of types and all their firms</p>
  <p>But I want to get the following list:</p>
  <p>I get a list of types and all their firms  and all their models</p>