2016-06-27 1 views

答えて

0

タスクを深夜に実行し、そのタスクで何をしたいかを設定できます。タスクスケジューリングhereのドキュメントをチェックしてください。

1

コントローラ機能を作成し、深夜に実行します。 はあなたがScheduleController

class ScheduleController extends Controller { 
    public function resetDataBase() 
    { 
    //write query here to change the table row. 
    //You may use raw queries 
    } 
} 

は、その後、あなたがアプリケーションをホストされているサーバーでApp\Console\Kernel.php

protected function schedule(Schedule $schedule) 
{ 
    $schedule->call('\App\Http\Controllers\[email protected]') 
    ->dailyAt('00:00'); 
} 

でこの関数を呼び出して考えてみましょう、あなたはセットアップにcrontabエントリを持って

* * * * * php /path/to/artisan schedule:run >> /dev/null 2>&1 

詳細はdocsを参照してください。

関連する問題