atannex / scopable
Declarative state and date scopes for Laravel Eloquent: published / scheduled / draft, active flags, schedule windows, expiry, highlights, limits and composites, with matching PHP checks, mutators, period scopes (createdThisWeek, publishedWithin), default states and transition events.
Requires
- php: ^8.2
- illuminate/console: ^11.0|^12.0
- illuminate/database: ^11.0|^12.0
- illuminate/events: ^11.0|^12.0
- illuminate/support: ^11.0|^12.0
- nesbot/carbon: ^3.0
Requires (Dev)
- orchestra/testbench: ^9.0|^10.0
- phpunit/phpunit: ^11.5
Suggests
- filament/filament: For Atannex\Scopable\Filament\StateFilter (^4.0).
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-10-30 11:14:53 UTC
README
Gives Laravel models ready-made states and date filters. You declare once what published, scheduled, draft, active or expired means for a model, and get matching database queries (such as published() or createdThisWeek()), the same checks on a single record, and events when a record changes state. It can also add matching tabs and filters to Filament admin pages.
Install
composer require atannex/scopable