## Getting Started
Install via Composer:
```bash
composer require shapecode/laravel-as-cron-job
Publish the config and migrations:
php artisan vendor:publish --provider="ShapeCode\AsCronJob\AsCronJobServiceProvider"
php artisan migrate
First use case: Define a daily job with pause windows (new in 1.0.2):
use ShapeCode\AsCronJob\AsCronJob;
class MyJob extends AsCronJob
{
protected $schedule = '* * * * *'; // Runs every minute
public function getPauseWindows()
{
return [
'weekdays' => [
'start' => '22:00', // 10 PM
'end' => '06:00', // 6 AM
],
'weekends' => [
'start' => '00:00', // Midnight
'end' => '00:00', // All day
],
];
}
}
Visualize your schedule with the new command:
php artisan shapecode:cron:visualize
AsCronJob and setting $schedule.tags: ['reporting']).getPauseWindows() to define time ranges where jobs skip execution.php artisan shapecode:cron:visualize --job=MyJob
Output example:
█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████
How can I help you explore Laravel packages today?