Download the PHP package schubu/cronify without Composer
On this page you can find all versions of the php package schubu/cronify. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download schubu/cronify
More information about schubu/cronify
Files in schubu/cronify
Package cronify
Short Description Adds cron functionality to your models.
License MIT
Homepage https://github.com/schubu/cronify
Informations about the package cronify
Cronify Package
Add cron-patterns to your models to check for validity. For example: you can check if a given post should be viewed.
Installation
You can install the package via composer:
After you've installed the package please run the installer. It published the migration file.
After that you've got to run your migration
A new crons table is added to your database. It stores your cron entries for your models.
Cronify your models
Next step is to add the Cronable trait to your models.
Usage
Given you've a post model with a title and a body field here is how to add a post with a cron pattern:
In this case you can ask for your pattern if it is due:
In our example it returns true only for the first of january.
Hints
You can add multiple cron patterns. If at least one rule matches you get true.
You can provide a date for the method so you can check the due of your model at a given date.
Validation
You can validate a submitted cron pattern by using
Submit your cron pattern as an associative array with the keys . If you submit the pattern as a string please split it into an array.
Roadmap
- add different rules for validation of a provided string and a provided array and
- integrate a form component
- integrate testing
comment: <> ()
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Credits
- Peter Schulze-Buxloh
- All Contributors
License
The MIT License (MIT). Please see License File for more information.