Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

thesogafoi's avatar

laravel scheduling run one time

Hey Guys i used Scheduling in laravel and do something like this in kernal

$schedule->command('mail:daily')->everyMinute();

and i created mail:daily command and when i run schedule :

php artisan schedule:run
Running scheduled command: '/usr/bin/php7.2' 'artisan' mail:daily > '/dev/null' 2>&1

it done and email sent but a problem i have ,

it send me email for one time, it is Not run mail:daily over and over in every minute why So what can i do

0 likes
10 replies
Snapey's avatar

You need a cron job that runs the schedule:run command per minute. Your schedule command will then check if it is time to run.

1 like
thesogafoi's avatar

How Can i do this ? @snapey

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

with this ?

thesogafoi's avatar

@snapey thx man

  1. can i do scheduling in local host Or not ?
  2. if we should cron Job then what is this methods :
 everyMinute

then this functions donot nothing for us

Snapey's avatar

Sorry I don't understand your question. You can schedule in local host but it depends if cron is supported.

You run the scheduler every minute (that is what * * * * * means) and then in the scheduler say everyDay, everyHour, everyMonday etc

1 like
thesogafoi's avatar

@snapey

I get it

in your article you run schedule in online Host but in local how can i do this ?

i use Homestead On windows

Snapey's avatar

You should be able to run cron in homestead.

Please or to participate in this conversation.