Download the PHP package chalcedonyt/laravel-specification without Composer
On this page you can find all versions of the php package chalcedonyt/laravel-specification. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download chalcedonyt/laravel-specification
More information about chalcedonyt/laravel-specification
Files in chalcedonyt/laravel-specification
Package laravel-specification
Short Description Implementation of the specification pattern
License MIT
Homepage https://github.com/chalcedonyt/laravel-specification
Informations about the package laravel-specification
laravel-specification
An adaptation of the Specification Pattern as done by https://github.com/domnikl/DesignPatternsPHP, adding an artisan command to quickly create specifications.
Install
Via Composer (please change your minimum-stability
to "dev")
Then run composer update
. Once composer is finished, add the service provider to the providers
array in app/config/app.php
:
Generating Specifications
An artisan command will be added to quickly create specifications.
Adding a --parameters
flag will prompts for parameters to be inserted into the constructor when generated:
Results in
Usage
You may also retrieve unfulfilled specifications via the remainderUnsatisfiedBy
property
Change log
- 0.4.4 You can now create a Specification inside a directory by specifying it in the classname, e.g.
php artisan make:specification MyDir\\MySpec
- 0.4.2 Removed the
isSatisfiedBy
method from the abstract and interface. This allows type hinting on the $candidate. - 0.4.1 Tweaked the generated views to use camel_case on any parameters.
- 0.4 Updated console command. You may now specify constructor parameters for the specification generator by entering the
--parameters
flag - 0.3 Removed functionality to type-hint the argument to isSatisfiedBy, as PHP doesn't allow overloading abstract methods.
- 0.2 Added
remainderUnsatisfiedBy
functions
Testing
Credits
- Dominic Liebler [https://github.com/domnikl/DesignPatternsPHP]
- C# Specification Framework by Firzen [https://specification.codeplex.com/]
- The original Specification Pattern document by Eric Evans and Martin Fowler [http://www.martinfowler.com/apsupp/spec.pdf]
License
The MIT License (MIT). Please see License File for more information.