I have a private function, as described below in the controller.
private function GetProjects($ProjectStatus) { return \App\Models\Project\Project_Model ::where('ProjectStatusID', $ProjectStatus) ->where('WhoCreatedTheProject', auth()->user()->UserID)->get(); }
The following is an action method that uses this private function.
public function ClientCancelledProjects() { $ProjectStatus = \App\Enumeration\Project\ProjectStatus::Cancelled; $MyProjects = GetProjects($ProjectStatus); return view("Project.Client.MyProject", array("Projects" => $MyProjects)); }
The following is an error starting the controller.
Calling the undefined function App \ Http \ Controllers \ Project \ GetProjects ()
Does anyone know why this is happening? I am trying to reuse some lines of code as they are written repeatedly in the controller.
user5694966
source share