GithubHelp home page GithubHelp logo

guoyu07 / generator-1 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from summerblue/generator

0.0 0.0 0.0 62 KB

Laravel 5.3+ Scaffold Generator, Support both bootstrap and Semantic UI

License: MIT License

PHP 100.00%

generator-1's Introduction

Laravel 5.x Scaffold Generator

Travis Packagist Tag

Laravel Scaffold Generator, for Laravel 5.3.

Install

Step 1: Install Through Composer

composer require 'summerblue/generator' --dev

Step 2: Add the Service Provider

Open /app/Providers/AppServiceProvider.php and, to your register function, add:

public function register()
{
     if (app()->environment() == 'local' || app()->environment() == 'testing') {

        $this->app->register(\Summerblue\Generator\GeneratorsServiceProvider::class);

    }
}

Step 3: Run Artisan!

You're all set. Run php artisan from the console, and you'll see the new commands make:scaffold.

Examples

Use this command to generator scaffolding of Project in your project:

php artisan make:scaffold Projects --schema="name:string:index,description:text:nullable,subscriber_count:integer:unsigned,default(0)"

This command will generate:

$ php artisan make:scaffold Projects --schema="name:string:index,description:text:nullable,subscriber_count:integer:unsigned,default(0)"

----------- scaffolding: Project -----------

+ ./database/migrations/2017_01_30_233548_create_projects_table.php
+ ./database/factories/ModelFactory.php
+ ./database/seeds/ProjectTableSeeder.php
+ ./database/seeds/DatabaseSeeder.php (Updated)
+ ./app/Models/Model.php (Updated)
+ ./app/Models/Traits/ProjectOperation.php
+ ./app/Models/Project.php
+ ./app/Http/Controllers/ProjectController.php
+ ./app/Http/Requests/Request.php
+ ./app/Http/Requests/ProjectStoreRequest.php
+ ./app/Http/Requests/ProjectUpdateRequest.php
+ ./app/Policies/Policy.php
+ ./app/Policies/KnowledgeBasePolicy.php
+ ./app/Providers/AuthServiceProvider.php (Updated)
+ ./routes/web.php (Updated)

--- Views ---
   + create_and_edit.blade.php
   + index.blade.php
   + show.blade.php
+ ./resources/views/error.blade.php
Migrated: 2017_01_30_233548_create_projects_table

----------- -------------------- -----------
-----------   >DUMP AUTOLOAD<    -----------

Explain

Generate the following:

  • Migration
  • Seed, add ModelFactory entry, and DatabaseSeeder entry
  • Base Model class, Model and helper trait
  • Resource Controller
  • Base FormRequest class and StoreRequest, UpdateRequest
  • Policy and Policy base class, auto register AuthServiceProvider class
  • Update routes file to register resource route
  • Add error page view
  • Create and Edit action share the same view

Future Plan

  • API
  • Admin
  • Auto fill FormRequest rule
  • Auto fill ModelFactory filed

Screenshot

file

Thinks to

generator-1's People

Contributors

summerblue avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.