title: Laravel model relationship across packages
body: <p>I'm trying to refactor my project from having all code under the App folder into seperate composer packages. However I've hit a blocker which I could use some input to solve:</p>
  
  <p>To simplify I'd like to create 2 packages, <code>Core</code> and <code>Customers</code>. I want <code>Core</code> to be fully seperated, having no references to any of my other packages. Inside <code>Core</code> there is a model called <code>Business</code>, and in <code>Customer</code> there is a model called <code>Customer</code>. There is a many-to-one relation ship between the models. The problem arises when I want to create the Eloquent relationship methods. <code>Customer</code> is dependant on <code>Core</code>, so this is not an issue, <code>$this-&gt;belongsTo(Business::class)</code>. However, to get the inverse <code>Core</code> needs to know about the <code>Customer</code> model, <code>$this-&gt;hasMany(Customer::class)</code>.</p>
  
  <p>Is there a way around this? Like maybe registering a method on the <code>Business</code> model from my <code>Customer</code> package? Or have I gotten it all backwards?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>For those not familiar with Laravel, a relationship is defined as a function in the model class</p>
  
  <pre><code>class Business extends Model {
     public function customers() {
         return $this-&gt;hasMany(Customer::class);
     }
  }
  </code></pre>