saritasa / laravel-tools
Laravel Tools
Requires
- php: >=7.1
- doctrine/dbal: ^2.6
- laravel/framework: ^5.4
- saritasa/php-common: ^1.1
- saritasa/transformers: ^1.0
- symfony/yaml: ^4.0
- wakeonweb/swagger: dev-master
Requires (Dev)
- mockery/mockery: ^1.0
- phpunit/phpunit: ^6.0
- squizlabs/php_codesniffer: ^3.0
README
This package was designed to help developers scaffold parts of code for Laravel-based projects.
Installation and configuration
Install the saritasa/laravel-tools
package as dev dependency:
$ composer require saritasa/laravel-tools --dev
If you use Laravel 5.4 or less,
or 5.5+ with package discovery disabled,
add the LaravelToolsServiceProvider in AppServiceProvider.php
:
public function register() { if ($this->app->environment() === 'local') { // If we are in local environment, enable some developer's tools ... $this->app->register(LaravelToolsServiceProvider::class); ... } }
Publish config with
$ artisan vendor:publish --tag=laravel_tools
Available artisan commands
artisan make:form_request ModelName FormRequestName
Allows to generate FormRequest class with rules based on model's attributes.
artisan make:dto ModelName DtoName
Allows to generate DTO class with properties based on model's attributes.
artisan make:api_routes
Allows to build API routes declaration based on swagger specification.
artisan make:api_controllers
Allows to scaffold API Controllers with actions based on swagger specification.
Documentation
Please, read our WIKI for complete documentation.
Known issues
- Enum DB type is casted as String via custom doctrine mapping
- Tinyint type is casted by Doctrine as Boolean
What's next?
What need to improve:
- Declare only necessary packages in composer.json instead of entire laravel
Contributing
See CONTRIBUTING and Code of Conduct, if you want to make contribution (pull request) or just build and test project on your own.