/** * Returns a new query object that can be used. * * @return mixed */ protected function getQuery() { $query = $this->model->newInstance(); if ($this->restrictByAccount) { $query->whereAccountId($this->currentAccountId()); } return $query; }
/** * Create a resource based on the data provided. * * @param array $data * * @return Resource */ public function getNew($data = []) { return $this->model->newInstance($data); }