Download the PHP package diontech/laravel-extended-scheduler without Composer
On this page you can find all versions of the php package diontech/laravel-extended-scheduler. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download diontech/laravel-extended-scheduler
More information about diontech/laravel-extended-scheduler
Files in diontech/laravel-extended-scheduler
Package laravel-extended-scheduler
Short Description This package allows you to configure the scheduled tasks of the app via (database) model. It was developed to avoid handling theseconfigurations via a config file only, cause then we cannot share the same repo to n server instances when running different tasks is needed at each server.
License MIT
Informations about the package laravel-extended-scheduler
Extend Laravel scheduler to can config tasks via model
This package allows you to configure the scheduled tasks of the app via (database) model. It was developed to avoid handling these configurations via a config file only, cause then we cannot share the same repo to n server instances when running different tasks is needed at each server.
This package will extend the laravel scheduler, so all coded scheduled tasks will still be available.
releases / laravel support
- laravel 8: v1.2.x
- laravel 9: v1.3.x
installation
using
Facade based handling
Instead of used model based handling mentioned below, you can also do Facade based handling, like:
Model based handling
At the moment you can do something similar to the following:
See https://laravel.com/docs/8.x/scheduling to get an idea of how it can be used.
normalizing inserted model to readable structure
make a command active / inactive
Each ScheduledCommand can be set to inactive / active by its property 'is_active'. the default value is false, so you must explicitly activate the command to be recognized in the laravel scheduler.
add description / notices to the command
Each ScheduledCommand have a property 'description', where you can save additional notices if needed.
get all registered / available commands of your application
model based
request response based
insert this in your controller, that's it:
NextSteps
- writing an API class
- make getCommands() method cacheable
- build some configs