sylarele / laravel-set
Set of interfaces, objects, and practices to standardise Laravel backends
Installs: 89
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 5
pkg:composer/sylarele/laravel-set
Requires
- php: >=8.3
- illuminate/console: ^10.0|^11.0|^12.0
- illuminate/contracts: ^10.0|^11.0|^12.0
- illuminate/http: ^10.0|^11.0|^12.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.88
- phpstan/phpstan: ^2.1
- phpstan/phpstan-strict-rules: ^2.0
- rector/rector: ^2.1
- shipmonk/composer-dependency-analyser: ^1.8
- dev-master
- v0.2.1
- v0.2.0
- v0.1.0
- v0.0.1
- dev-dependabot/composer/master/illuminate/contracts-12.35.1
- dev-dependabot/composer/master/illuminate/http-12.35.1
- dev-dependabot/composer/master/rector/rector-2.2.6
- dev-dependabot/composer/master/illuminate/console-12.35.1
- dev-dependabot/composer/master/phpstan/phpstan-2.1.31
- dev-dependabot/github_actions/master/actions/checkout-5
This package is auto-updated.
Last update: 2025-10-29 11:12:15 UTC
README
Set of interfaces, objects, and practices to standardise Laravel backends
Schedule list
Initialise your schedule directory
app/
└─ Schedule/
├─ Command/ # for $schedule->command
└─ Job/ # for $schedule->job
Add your commands and jobs. Then return an anonymous class that inherits from Sylarele\LaravelSet\Contract\Console\ScheduleInterface.
<?php declare(strict_types=1); use App\Console\Command\AcmeCommand; use Illuminate\Console\Scheduling\Schedule; use Sylarele\LaravelSet\Contract\Console\ScheduleInterface; return new class() implements ScheduleInterface { public function handle(Schedule $schedule): void { $schedule->command(AcmeCommand::class)->dailyAt('08:00'); /* [...] */ } };
Then declare your commands in the kernel
In Laravel 10
<?php namespace App\Console; use Illuminate\Console\Scheduling\Schedule; use Illuminate\Foundation\Console\Kernel as ConsoleKernel; use Sylarele\LaravelSet\Service\ScheduleHandler; class Kernel extends ConsoleKernel { protected function schedule(Schedule $schedule): void { $scheduleHandler = new ScheduleHandler([ base_path('app/Schedule/Command/*.php'), base_path('app/Schedule/Job/*.php'), ]); $scheduleHandler->handle($schedule); } /* [...] */ }
In Laravel >= 11
use Sylarele\LaravelSet\Service\ScheduleHandler; ->withSchedule( (new ScheduleHandler([ dirname(__DIR__).'/app/Schedule/Command/*.php', dirname(__DIR__).'/app/Schedule/Job/*.php', ])) ->handle(...) )
See the schedule list :
php artisan schedule:list