I work with Laravel Task Scheduling, but I have a problem when I call some method from my controller.
protected function schedule(Schedule $schedule)
{
$schedule->call('UserController@deleteInactiveUsers')->everyMinute();
}
When I call with an undocumented string, I get this error:
[ReflectionException]
Class RecurrenceInvoiceController does not exist
and then I insert the full namespace path, and then I get this error:
[PDOException] SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name or service not known
AND
[ErrorException] PDO::__construct(): php_network_getaddresses: getaddrinfo failed: Name or service not known
Where is the problem? Which method is correct for calling a method from a controller from Laravel Task Scheduling.
source
share