/**
  * 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;
 }
예제 #2
0
파일: User.php 프로젝트: alchemyphp/gate
 /**
  * Add default clauses to the fetched user.
  */
 public function newQuery()
 {
     return parent::newQuery()->with('profile');
 }