It is suitable for rapid B-side background development, and generates corresponding Model, Observer, Controller, View, Route and other related project files according to the MySQL table structure.
[TOC]
Installation
Expansion Pack
Composer require sunshinev/laravel-gii -vvv
Post
This operation will publish assets static files to the public directory
php artisan vendor: publish
selectTag: laravel-gii
Visit
http: [domain]/gii/model
Instructions
Generate Model
Form description
- Table name (support drop-down selection)
- Model class name (want to create model classes, including namespaces)
- Parent class of model inheritance (If it is Mongo, it can inherit
Jenssegers \ Mongodb \ Eloquent \ Model
, MySQL usesIlluminate \ Database \ Eloquent \ Model
)
The generated file list, blue represents a new file, red represents an existing file but different, and white represents an existing file.
Generate CRUD
The creation of CRUD depends on the previously created model.
This operation will also generate:
- route
- controller
- views
Form description
- Controller name (including namespace)
- The model class created earlier
Features
MySQL list loading
Pull list from configured MySQL database
File comparison
The tool will compare the newly generated file with the existing file, which is convenient for viewing the modified part and controlling the scope of the modification.
Route Append
Newly generated pages are automatically appended to the routing configuration file
CRUD background effects
List
Includes comprehensive additions, deletions, and changes
- List
- Pagination
- Retrieve
- Delete + batch delete
- Preview
- Details
- Edit
delete + batch delete
Cancel button zoom in to prevent accidental deletion
Row Preview
Edit page
Suggest
What if you want to use Mongo?
If the Model is generated, the connection configured in the env will be used by default. If you need to adjust, you need to modify the generated Model file.
// if connection is empty, use default connection
protected $ connection = '';
How do background pages support other components?
The background page uniformly uses iview as the front-end framework. Currently, all components of iview4 are supported. You can add components directly to the generated blade template file.
How to upgrade the iview component of the page?
The generated CRUD background is based on laravel-fe-render and [base-fe](https://github.com/sunshinev/base -fe) Two projects, of which base-fe
is a package of Vue + iview, as follows:
import Vue from 'vue'
import ViewUI from 'view-design';
import 'view-design/dist/styles/iview.css';
Vue.use (ViewUI);
You can Fork the base-fe
project, and then upgrade the iview. Place the generated dist directory in theassets
directory of the laravel-fe-render
project, and then republish it.
Relevant information
https://github.com/sunshinev/laravel-fe-re...