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

zerophreak's avatar

Run artisan command through Laravel Forge Scheduler

I would like to schedule a comman through Laravel Forge's Scheduler, NOT in my Laravel project itself. In the setup, my Forge is deployed by Envoyer, so what I'd do is schedule a job in Forge with:

Frequency: whatever I want User: forge Command: php /home/forge/www.project.com/current/artisan generate:list

However, when scheduling this, it breaks by saying: "fatal: not a git repository (or any of the parent directories): .git"

Any idea?

0 likes
4 replies
zhxscript's avatar

If your using Envoyer to deploy your project to your server, you should schedule the command through Envoyer and not forge.

See https://envoyer.io/docs section deployment hooks.

zerophreak's avatar

@ZHXSCRIPT - Hey mate, thanks a lot but it's not for deployment hooks but for scheduling a command on a regular basis. Laravel Forge offers this with "Scheduler", however it won't work...

zhxscript's avatar
Level 2

@zerophreak

ah ok, my bad...

Could try the below command..

cd /home/forge/www.project.com/current && php artisan schedule:run

I've gotten a similar setup to work but stopped using Envoyer, and I cant remeber exactly how I did it, but I think it was something like this.

Also make sure your sites web directory is /current/public and not just /public

1 like

Please or to participate in this conversation.