Download the PHP package maartenpaauw/laravel-specification-pattern without Composer
On this page you can find all versions of the php package maartenpaauw/laravel-specification-pattern. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download maartenpaauw/laravel-specification-pattern
More information about maartenpaauw/laravel-specification-pattern
Files in maartenpaauw/laravel-specification-pattern
Package laravel-specification-pattern
Short Description This is my package laravel-specification-pattern
License MIT
Homepage https://github.com/maartenpaauw/laravel-specification-pattern
Informations about the package laravel-specification-pattern
Laravel specification pattern
Filter an Illuminate collection with specifications.
Support me
You can support me by buying Pennant feature flags for Filament.
Installation
You can install the package via composer:
You can publish the config file with:
This is the contents of the published config file:
Usage
Here's how you can create a specification:
This will generate a specification class within the App\Specifications
namespace.
Imagine we have the following class which represents a person with a given age.
Let's apply the business logic:
After applying the bussiness logic we can use the specification by directly calling the isSatisfiedBy
method or indirectly be filtering an eloquent collection by calling the matching
method.
Direct
Indirect
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- Maarten Paauw
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-specification-pattern with dependencies
illuminate/console Version ^11.0|^12.0
illuminate/support Version ^11.0|^12.0
spatie/laravel-package-tools Version ^1.16.2
symfony/polyfill-php83 Version ^1.30
webmozart/assert Version ^1.11