How to Set Up Cron in a Laravel Project
hayatonjp
HOBBYOP

a year ago

I am running a Laravel project with a custom domain.
After setting a cron schedule and adding a php artisan ~ command to the Custom Start, deploying the project results in a "Host Error" from Cloudflare.
What is the correct procedure for setting up cron jobs in a Laravel project in this case?

Solved$10 Bounty

Pinned Solution

a year ago

Oh, awesome!

3 Replies

a year ago

This thread has been marked as public for community involvement, as it does not contain any sensitive or personal information. Any further activity in this thread will be visible to everyone.

Status changed to Open brody 11 months ago


a year ago

Been wasting more time with Cloudflare than it is actually sane, so here we go: Just leave your Laravel web service doing its normal thing (Nginx + PHP or whatever), don’t shove a while-loop cron in there or Cloudflare freaks out lol. Instead, hop into Railway’s Cron tab, slap in * * * * * and point it at php artisan schedule:run. Just pick the same image and voilà.


hayatonjp
HOBBYOP

a year ago

It was a basic mistake.
I created a new service specifically for the cron job, separate from the service with the custom domain, and simply set up the cron there — and it worked.


a year ago

Oh, awesome!


Status changed to Solved itsrems 11 months ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...