コード例 #1
0
 /**
  * Find a model by its primary key or throw an exception.
  *
  * @author Steve Montambeault
  * @link   http://stevemo.ca
  *
  * @param  int $id
  * @param  array $columns
  * @return \Illuminate\Database\Eloquent\Model
  *
  * @throws \Illuminate\Database\Eloquent\ModelNotFoundException
  */
 public function findOrFail($id, array $columns = array('*'))
 {
     return $this->model->newQuery()->findOrFail($id);
 }
コード例 #2
0
 /**
  * Creates a new QueryBuilder instance and adds any relationships to be eager-loaded
  */
 public function newQuery()
 {
     $this->embeddedData = [];
     $this->query = $this->model->newQuery();
     return $this;
 }