litalico-engineering / eg-r2
Easy request validation and route generation from open API specifications (for Laravel)
Installs: 3 392
Dependents: 0
Suggesters: 0
Security: 0
Stars: 7
Watchers: 6
Forks: 1
Open Issues: 1
Requires
- php: ^8.2|^8.3
- illuminate/console: ^11.0
- illuminate/support: ^11.0
- illuminate/validation: ^11.0
- nette/php-generator: ^4.1
- zircote/swagger-php: ^4.8
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.46
- orchestra/testbench: ^9.0
- phpstan/phpstan: ^1.10
- phpunit/phpunit: ^11.2
- smeghead/php-vendor-credits: ^0.0.5
- spaze/phpstan-disallowed-calls: ^3.1
This package is auto-updated.
Last update: 2025-01-06 06:32:03 UTC
README
Easy request validation and route generation from open API specifications (for Laravel)
eg-r2
means eg
in the sense that it Easy(eg)
the two R(r2)
s Request validation
and Routing generation
.
Installation
- composer install
composer require litalico-engineering/eg-r2
- vendor publish
php artisan vendor:publish --provider="Litalico\EgR2\Providers\GenerateRouteServiceProvider"
Usage
- Add swagger-php attributes to the classes (Controller and FormRequest) corresponding to each API to create an OpenAPI document.
see. https://zircote.github.io/swagger-php/guide/attributes.html
Important
No need to define routing for Controller methods
- Configure the
config/eg-r2.php
Describe the namespace of the Controller that describes the OpenAPI Attribute - Generate Route Files
php artisan eg-r2:generate-route