/**
  * Create a new newQuery instance with eager loaded relationships.
  *
  * @return newQuery
  */
 protected function newQuery()
 {
     $query = $this->model->newQuery();
     foreach ($this->withRelationships as $relationship) {
         $query->with($relationship);
     }
     return $query;
 }
Example #2
0
 /**
  * Add default clauses to the fetched user.
  */
 public function newQuery()
 {
     return parent::newQuery()->with('profile');
 }