- Laravel Version: 5.7.25
- PHP Version: 7.2.14
- Database Driver & Version: MySQL 2ª gen. 5.7
Hi, Sorry for the trouble, I have this problem in creating a scheduled command.
Description:
In our crontab -e user we have inserted the following on Debian:
* * * * * cd /var/www/myfolder.com/ && php artisan schedule:run >> crontab.laravel
We have correctly entered the schedule function as follows:
app/console/kernel.php
<?php
namespace App\Console;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
class Kernel extends ConsoleKernel
{
/**
* The Artisan commands provided by your application.
*
* @var array
*/
protected $commands = [
// 'App\Console\Commands\HelpCenter',
Commands\HelpCenter::class
];
/**
* Define the application's command schedule.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @return void
*/
protected function schedule(Schedule $schedule)
{
$schedule->command('elena:help')->everyMinute();
}
/**
* Register the commands for the application.
*
* @return void
*/
protected function commands()
{
$this->load(__DIR__ . '/Commands');
require base_path('routes/console.php');
}
}
but the result continues to be No scheduled commands are ready to run we tried all the combinations impossible but nothing. If we uncomment the function Artisan call working, the script is executed
Try to force command crontab -e
To better understand where the problem lies We have added a crontab directly with the command without going through the schedule as :
* * * * * cd /var/www/myfolder.com/ && php artisan elena:help >> crontab.laravel
This command runs perfectly every minute so we can not figure out where the problem is. if you have the patience to give us some advice we will be happy. good day