- Notifications
You must be signed in to change notification settings - Fork13
Laravel package to add command to list all scheduled artisan commands
License
hmazter/laravel-schedule-list
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Laravel 5.6+ package to add a artisan command to list all scheduled artisan commands.With schedule time (cron expression), the command to execute and the command description.
Require this package with composer using the following command:
composer require hmazter/laravel-schedule-list
Note! For Laravel version 5.5 and below use0.2.0 tag.
Usage from the command line to show all your scheduled artisan commands:
php artisan schedule:list
Outputs:
+--------------+---------------------+--------------+-------------------------------+ | expression | next run at | command | description | +--------------+---------------------+--------------+-------------------------------+ | 0 14 * * 3 * | 2017-08-16 14:00:00 | email:export | Export users to email service | +--------------+---------------------+--------------+-------------------------------+Use--cron to show the output in the same style as it would go in a crontab file.
Outputs:
0 14 * * 3 * '/usr/local/bin/php' 'artisan' email:export > '/dev/null' 2>&1`Use-vv to show the full command, including php binary path and output path.
Outputs:
+--------------+---------------------+----------------------------------------------------------------+-------------------------------+| expression | next run at | command | description |+--------------+---------------------+----------------------------------------------------------------+-------------------------------+| 0 14 * * 3 * | 2017-08-16 14:00:00 | '/usr/local/bin/php' 'artisan' email:export > '/dev/null' 2>&1 | Export users to email service |+--------------+---------------------+----------------------------------------------------------------+-------------------------------+Using-vv together with--cron does not change to output from normal--cron output.
For occasions when you need to access the list of scheduled events programmatically\Hmazter\LaravelScheduleList\ScheduleList::all exists that will return all the scheduled events as an array ofScheduleEvent.
Inject theScheduleList or resolve it from the Container and then callall() to get all scheduled events.Usage of it can be seen inListScheduler::handle
If you use custom PHP Binary paths or you are using\Hmazter\LaravelScheduleList\ScheduleList::all within the context of a web application and not through the console, you can publish the package config file and defining your own binary path:
php artisan vendor:publish --provider="Hmazter\LaravelScheduleList\ScheduleListServiceProvider" --tag="config"For exampleconfig/schedule-list.php:
<?phpreturn [ 'remove_strings_from_command' => [ "'".PHP_BINARY."'", "'artisan'", ],];Laravel ships with some special scheduling functions exbetween,unlessBetween,when andskipthese are not handled right now in the schedule listing output.They are evaluated at each execution of the schedule and does not define any expression that can be included in the table.
About
Laravel package to add command to list all scheduled artisan commands
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Uh oh!
There was an error while loading.Please reload this page.
Contributors4
Uh oh!
There was an error while loading.Please reload this page.