Skip to content
How to Set Up Cron in a Laravel Project
hayatonjp
OP

2 years 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

2 years ago

Oh, awesome!

3 Replies

2 years 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 • over 1 year ago


2 years 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
OP

2 years 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.


2 years ago

Oh, awesome!


Status changed to Solved ntheck • over 1 year ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...