title: Laravel 5: How to use remote model?
body: <p>I want to create a model for external API, that would allow me to run operations like get(), where() etc. An example:</p>
  
  <pre><code>$users = UserFromApi::get(); // Get all users from api
  $activeUsers = UserFromApi::where('active', 1)-&gt;get();
  </code></pre>
  
  <p>I come to Laravel from CakePHP. In CakePHP it's done by providing custom datasource and connection for the model.</p>
  
  <p>For Laravel 4 there's a nice library called Trucker  (<a href="https://github.com/indatus/trucker" rel="nofollow">https://github.com/indatus/trucker</a>), but I've found absolutely no other reasonable tool for L5.</p>
  
  <p>What is the correct approach to the problem of "mapping model to external api"?</p>