/** * Gets the project associated with this request. * * @return \App\Project project */ public function project() { if ($this->project == null) { $title = urldecode(substr($this->url(), strrpos($this->url(), '/') + 1)); $this->project = Project::fromName($title)->firstOrFail(); } return $this->project; }