Laravel-Gii visual code generation tool CRUD + GUI

Laravel-Gii visual code generation tool CRUD + GUI

GIT:https://github.com/sunshinev/laravel-gii

For fast B-side back-end development

According to MySQL table structure to generate the corresponding Model, Observer, Controller, View, Route and other associated project files, automatically create a complete CRUD background with a simple click of the mouse.

image

Need to know before installing

Project to Create a template need to rely on "github: laravel-fe-render " project, as a template resolution.

App.js the background page relies project to compile "github: base-fe"

installation

Installation package

Composer require sunshinev/laravel-gii -vvv

Published documents

This operation will release assets static files, to lower public directory

php artisan vendor:publish

select
Tag: laravel-gii

Add Route

Route::any('/gii/model','\Sunshinev\Gii\Controllers\ModelController@index');
Route::any('/gii/crud','\Sunshinev\Gii\Controllers\CrudController@index');

Then access it

http:[domain]/gii/model

use

Creating Model Model

Form Description

  1. Table names (support drop-down selection)
  2. Model class name (you want to create a model class, include the namespace)
  3. The model is derived from the parent class (if it is Mongo can be inherited Jenssegers\Mongodb\Eloquent\Model, MySQL use Illuminate\Database\Eloquent\Model)

A list of files generated, blue represents the new file, and red for an existing file, but there are different, white represents an existing file.

image

Create a CRUD

CRUD creation, need to rely on the model created previously.

This will also generate:

  • route
  • controller
  • views

Form Description

  1. Controller name (include the namespace)
  2. Before you create the model class

image

Differences file compare

image

The final contents of the file

image

After you create a background page

List

The page includes the ability to:

  • List
  • Paging
  • Retrieval
  • + Delete bulk deletion
  • Preview
  • Detail
  • edit

image

+ Delete bulk deletion

Cancel button to zoom in, to prevent accidental deletion

image

Line Preview

image

Edit Page

image

related question

  1. If, after completion of generation Model, the default configuration will be used in connection env, if adjustment is required, modify the Model file.

Guess you like

Origin blog.51cto.com/11214459/2454218