Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save shaz-r/9bd9608711291d83c6297a17c9ce76a6 to your computer and use it in GitHub Desktop.

Select an option

Save shaz-r/9bd9608711291d83c6297a17c9ce76a6 to your computer and use it in GitHub Desktop.
Add the following route to the `App\Http\routes.php`:
```
Route::post('artisan-scheduler', function(){
Artisan::call('schedule:run');
});
```
And add the following to a `cron.yaml` to the root of the project directory (where composer.json, phpunit.xml etc sit):
```
version: 1
cron:
- name: "artisan-schedule-run" # required - unique across all entries in this file
url: "/artisan-scheduler" # required - does not need to be unique
schedule: "* * * * *" # required - does not need to be unique
```
@shalonteoh
Copy link

Thanks!!!!! very clear and simple!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment