maras0830 / laravel-srt
Service, Repository, Transformer simple generator.
Installs: 16 453
Dependents: 0
Suggesters: 0
Security: 0
Stars: 5
Watchers: 4
Forks: 2
Open Issues: 0
Requires
- illuminate/database: ~5.0|~6.0|~7.0|^8.0|^9.0|^9.1|^10.0|^11.0
- illuminate/pagination: ~5.0|~6.0|~7.0|^8.0|^9.0|^10.0|^11.0
- league/fractal: ^0.17.0
README
SRT = Service + Repository + Transformer
Generator tool
Installation
$ composer require maras0830/laravel-srt
USAGE
Make Service
$ php artisan make:service UserService
Make Repository
$ php artisan make:repository UserRepository
Make Transformer
$ php artisan make:transformer UserTransformer
Make Service+Repository+Transformer
$ php artisan make:srt User
Eager query check & Strict Mode
in your CustomerTransformer file
public function __construct() { // set your eager query required relations. $this->setRequiredRelations(['notificationable']); // false: laravel-srt log warning when you forgot eager query( ->with(['notificationable']) ) // true: laravel-srt throw TransformerException when you forgot eager query( ->with(['notificationable']) ) $this->setStrictMode(false); }