title: Laravel eager loading with join on other table
body: <p>can i change this code to syntax of has_many or has_one or ... to write beautiful code?</p>
  
  <pre><code>\App\User::with(['books' =&gt; function ($query) {
      $query-&gt;join('locations','books.location_id','=','locations.id')
      -&gt;select([
          'books.*',
          'locations.name as l_name'
      ]);
  }])-&gt;get()
  </code></pre>
  
  <p>Class User:</p>
  
  <pre><code>public function books()
  {
      return $this-&gt;hasMany(Book::class);
  }
  </code></pre>