Lakshika De Silva
Lakshika De Silva

Reputation: 1

Laravel Scheduled job

I'm running CRON JOB with Laravel.

I scheduled it as given below. $schedule->command('remind:planner_notif')->cron('* * * * *')->withoutOverlapping();

But I wanted to run it forever like while loop.

Upvotes: 0

Views: 159

Answers (2)

MohamedSabil83
MohamedSabil83

Reputation: 1549

You can do like this:

$schedule->command('remind:planner_notif')->everyMinute()->withoutOverlapping();

or for example daily:

$schedule->command('remind:planner_notif')->daily()->withoutOverlapping()

and make sure in your hositng run the this:

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

Upvotes: 1

Sandeesh
Sandeesh

Reputation: 11906

You have to do that in the command that is being executed. The scheduler's job is to run the command and nothing more. So add the conditions needed in the code for the command remind:planner_notif

Upvotes: 0

Related Questions