2017 © Pedro Peláez
 

package artisan-scaffolding

image

ahmed-aliraqi/artisan-scaffolding

  • Friday, September 22, 2017
  • by ahmed-aliraqi
  • Repository
  • 0 Watchers
  • 0 Stars
  • 29 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 7 % Grown

The README.md

Artisan Scaffolding

This package adds some artisan commands to generate relations, helpers, scopes, concerns, mutators, transformers files and override the laravel original artisan commands as your like., (*1)

NOTE : the view artisan commands was forked from sven/artisan-view, (*2)

Installation

Via composer:, (*3)

composer require ahmed-aliraqi/artisan-scaffolding

Or add the package to your dependencies in composer.json and run composer update to download the package:, (*4)

{
    "require": {
        "ahmed-aliraqi/artisan-scaffolding": "^1.0"
    }
}

Note: If you're using Laravel 5.5, you're done! The service provider is automatically registered in the container, thanks to auto-discovery., (*5)

Next, add the ServiceProvider to your providers array in config/app.php:, (*6)

// config/app.php
'providers' => [
    ...
    Aliraqi\Artisan\Scaffolding\Providers\ServiceProvider::class,
];

Usage

If you now run php artisan you can see 8 new commands: - make:helper - make:mutator - make:relation - make:scope - make:concern - make:transformer - make:view - scrap:view, (*7)

These commands was overrided by this package : - make:model : add the fillable as default. - make:controller : add generate request option and generate full resource, nested controller . - make:policy : add listing method and replace the user variable name to auther if the created policy file name is user - make:request : division the rules by method name and change the authorize method return to true by default., (*8)

If you want to change your project character run this command to publish the config file :, (*9)

php artisan vendor:publish --provider=Aliraqi\Artisan\Scaffolding\Providers\ServiceProvider --tag=config
// config/artisan-scaffolding.php

<?php
return [
    /**
     * the default namespace for the models classes.
     *
     * if you change the default namespace you need to change user model namespace in these files :-
     * - config/auth.php
     * - config/services.php
     * - app/Http/Controllers/Auth/RegisterController.php
     * - database/factories/ModelFactory.php
     *
     */
    'models_default_namespace' => 'App',

    /**
     * the default namespace for the relations traits.
     *
     */
    'relations_default_namespace' => 'App\Relations',

    /**
     * the default namespace for the concerns traits.
     *
     */
    'concerns_default_namespace' => 'App\Concerns',

    /**
     * the default namespace for the mutators traits.
     *
     */
    'mutators_default_namespace' => 'App\Mutators',

    /**
     * the default namespace for the scopes traits.
     *
     */
    'scopes_default_namespace' => 'App\Scopes',

    /**
     * the default namespace for the helpers traits.
     *
     */
    'helpers_default_namespace' => 'App\Helpers',

    /**
     * the default namespace for the policies classes.
     *
     */
    'policies_default_namespace' => 'App\Policies',

    /**
     * the default namespace for the requests classes.
     *
     */
    'requests_default_namespace' => 'App\Http\Requests',

    /**
     * the default namespace for the controllers classes.
     *
     */
    'controllers_default_namespace' => 'App\Http\Controllers',

    /**
     * the default namespace for the transformer classes.
     *
     */
    'transformers_default_namespace' => 'App\Transformers',
];



If you want to change stubs files content run this command :
php artisan vendor:publish --provider=Aliraqi\Artisan\Scaffolding\Providers\ServiceProvider --tag=stubs

Now you can see the stubs files in this path app\Console\stubs, (*10)

License

sven/artisan-view is licensed under the MIT License (MIT). Please see the license file for more information., (*11)

The Versions

22/09 2017

dev-master

9999999-dev

  Sources   Download

MIT

by Avatar ahmed-aliraqi

22/09 2017

dev-analysis-XVAL23

dev-analysis-XVAL23

  Sources   Download

MIT

by Avatar ahmed-aliraqi

24/07 2017

v1.0.1

1.0.1.0

  Sources   Download

MIT

by Avatar ahmed-aliraqi

15/07 2017

v1.0.0

1.0.0.0

  Sources   Download

MIT

by Avatar ahmed-aliraqi