```php
namespace App\Console;
use Artisan;
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\Inspire',
];
/**
* Define the application's command schedule.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
*/
protected function schedule(Schedule $schedule)
{
// 當exec被disabled時只要改成使用Artisan::call('command')即可
$schedule->call(function () {
Artisan::call('inspire');
})
->hourly();
}
}
```
沒有留言:
張貼留言