Download the PHP package saritasa/laravel-entity-services without Composer
On this page you can find all versions of the php package saritasa/laravel-entity-services. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-entity-services
Laravel Entity Services
Library for fast build laravel based application with simple CRUD operations.
As Repositories layer uses laravel-repositories library.
Laravel 5.5/6.0
Install the package:
Usage
Get service for model:
*Note: if entity class not exists, EntityServiceException will be thrown
Configuration
Publish file
To publish configuration file you can run next command:
It will copy file laravel_entity_services.php in config directory.
Register custom entity service implementation
To register your own IEntityService implementation you can put it into configuration file, like:
NOTE: Just remember that default IEntityServiceFactory implementation can work only with classes extended from EntityService. If you want change this behavior you should add your own implementation.
Available operations:
Create:
Update:
Delete:
Custom service for entity:
If you need use custom service for some entity, you can register it in factory using register
method.
Example:
Note: Your realization must be extend EntityService class
Events
EntityCreatedEvent - Throws when entity is created.
EntityUpdatedEvent - Throws when entity is updated.
EntityDeletedEvent - Throws when entity is deleted.
Contributing
- Create fork, checkout it
- Develop locally as usual. Code must follow PSR-1, PSR-2 -
run PHP_CodeSniffer to ensure, that code follows style guides - Cover added functionality with unit tests and run PHPUnit to make sure, that all tests pass
- Update README.md to describe new or changed functionality
- Add changes description to Semantic Versioning convention to determine next version number.
- When ready, create pull request
- Develop locally as usual. Code must follow PSR-1, PSR-2 -
Make shortcuts
If you have GNU Make installed, you can use following shortcuts:
- (instead of ) -
run static code analysis with PHP_CodeSniffer
to check code style - (instead of ) -
fix code style violations with PHP_CodeSniffer
automatically, where possible (ex. PSR-2 code formatting violations) - (instead of ) -
run tests with PHPUnit -
- instead of * or just without parameters -
invokes described above install, cs, test tasks sequentially -
project will be assembled, checked with linter and tested with one single command
- instead of * or just without parameters -
Resources
All versions of laravel-entity-services with dependencies
illuminate/support Version >=5.0 <12.0
saritasa/laravel-repositories Version ^4.0