title: Global laravel model
body: <p>So I'm developing a site. It's being hosted on one dedicated server, but will have several domain names pointing to a single Laravel 5.1 installation.</p>
  
  <p>Each domain name (not including the subquery) is owned by a Client model. 
  Each client can have multiple sites, which are defined by the subdomain.</p>
  
  <p>For example, I own <code>phil-cross.co.uk</code>. So in my client table I have a record for a client with the domain <code>phil-cross.co.uk</code>.</p>
  
  <p>I then have multiple records in my <code>Sites</code> table, for <code>www.phil-cross.co.uk</code> or <code>blogs.phil-cross.co.uk</code> and so on.</p>
  
  <p>The application can also manage other domains. So I might have another client with the domain name <code>joe-bloggs.com</code>. </p>
  
  <p>At the moment my laravel application can correctly determine the client by the domain name, and the site by the subdomain, but the way it does it is quite messy.</p>
  
  <p>At the moment, I have a service provider which has a static <code>client</code> and <code>site</code> property, and the boot method loads the current client and site and stores them within this service provider. I then have a facade with some helper methods which can access the client and site properties from the service provider.</p>
  
  <p>I want to, at any given time within the life of the application to be able to access the Client and Site model for the current site. </p>
  
  <p>Is there a best practice within laravel for storing globally accessible models? Is my Service Provider / Facade way of currently doing it acceptable or should it be middleware? Is there other ways of doing it that I'm unaware of?</p>
  
  <p><strong>Tldr:</strong></p>
  
  <p>How can I create a single instance of a model, and access it at any time, and anywhere within the laravel application.</p>