saritasa/laravel-tools

1.5.1 2019-01-31 10:59 UTC

README

Build Status CodeCov Release PHPv Downloads

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

What's next?

What need to improve:

  1. 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.

Resources