共享主机和时间表:运行laravel

时间:2018-09-18 06:46:58

标签: php laravel

我有一个共享主机,我想运行我的日程表。但我不知道如何在我的面板中设置地址。

这是我的时间表:

<?php

namespace App\Console;

use App\Jobs\SendOrdersResultNotification;
use App\Order;
use App\RequestForBarber;
use Carbon\Carbon;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;

class Kernel extends ConsoleKernel
{
    protected $commands = [
        '\App\Console\Commands\GetBarbers',
    ];

    protected function schedule(Schedule $schedule)
    {
        $schedule->call(function (){
            $requests=RequestForBarber::where('flag','=',1)->get();
            foreach ($requests as $request){
                RequestForBarber::destroy($request->id);
            }
        })->hourly();

    }


    protected function commands()
    {
        $this->load(__DIR__.'/Commands');

        require base_path('routes/console.php');
    }
}

https://laravel.com/docs/5.6/scheduling

* * * * * cd /path-to-your-project && php artisan schedule:run >> /dev/null 2>&1

根据上述文档,我不知道如何在cpanel中设置cron。

enter image description here

0 个答案:

没有答案