2
好了,所以我已經安裝了https://github.com/liebig/cron 一切與這工作等等克龍在laravel(使用https://github.com/liebig/cron)
我有,雖然實現這個麻煩。 在我laravel /程序/啓動/ global.php
我把這個:
Event::listen('cron.collectJobs', function() {
Cron::add('deposit_reminder', '* * * * *', function() {
foreach (Site::where('org_id', Auth::user()->organization->id)->get() as $site){
foreach (Game::get() as $game) {
ALOT MORE CORE IS HERE thats not really relevant to see
Cron::setEnableJob('deposit_reminder');
return null;
});
});
有了這個代碼在global.php我認爲正在發生的事情是,我想用戶驗證::用戶() - >等...但在這一點上登錄將不會被解僱,因爲這是在laravel啓動我想?
我試圖把這個代碼放到routes.php中,並且在成功登錄後,這個cron作業會被創建,但是當我這樣做的時候它似乎沒有爲cronjob創建作業......有沒有人有任何建議?