title: Interpreting Database Design into Laravel Model Relation
body: <p>I want to do relation in laravel with this database, what I wanted to happen is I can access all the data from <code>ReportProduct</code> Model</p>
  <p><a href="https://i.stack.imgur.com/Uexrt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Uexrt.png" alt="database" /></a></p>
  <p>what i have done is to relation one at a time:</p>
  <p><code>ReportProduct</code> Model:</p>
  <pre><code>class ReportProduct extends Model
  {
  
      public function product()
      {
          return $this-&gt;hasMany(Product::class, 'product_id', 'product_id');
      }
      public function store()
      {
          return $this-&gt;hasMany(Store::class, 'store_id', 'store_id');
      }
  }
  </code></pre>
  <p><code>Store</code> Model:</p>
  <pre><code>public function storing()
      {
          return $this-&gt;hasManyThrough(StoreAccount::class, StoreArea::class, 'area_id', 'account_id', 'account_id', 'area_id');
      }
  </code></pre>
  <p><code>Product</code> Model:</p>
  <pre><code>class Product extends Model
  {
  
      public function productBrand()
      {
          return $this-&gt;hasmany(ProductBrand::class,'brand_id','brand_id');
      }
  
      public function report(){
          return $this-&gt;belongsTo(ReporttProduct::class,'product_id','product_id');
      }
  }
  </code></pre>
  <p>what can i do to achieve it?</p>
  <p>Thank you in advanced!</p>