machecaz / marlon-lumen
Installs: 119
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/machecaz/marlon-lumen
Requires
- php: ^7.4|^8.0
 - spatie/laravel-enum: ^2.4
 
Requires (Dev)
- laravel/lumen: 8.x.x
 
README
Usage
- 
Register provider into
bootstrap/app.php:$app->register(Marlon\Lumen\Providers\MarlonLumenServiceProvider::class);
 - 
Add ErrorHandler trait to
app/Exceptions/Handler.php. 
Commands
- make:request -> Create a FormRequest.
 - make:response -> Create a Responsable class.
 - run:test -> A shortcut command for run test using phpunit.
 
Enums
This package use spatie/enum for enable enum feature (we are waiting for php 8.1 that will provides native enum).
- RoleEnum -> user roles.
 
Helper classes
- Auth -> get values from marlon custom header (proxy will pass them).
 - ValidationErrors -> a helper class for throw a ValidationException.
 
Traits
- ArrayObjectArrayable -> implements a recursive "objects to array" method.
 - ErrorHandler -> core class for handle ValidationException and return a 422 response with errors.
 - ObjectArrayable -> implements a recursive "object to array" method for object.