Laravel-Gii Visual code generation tool CRUD + GUI

Laravel-Gii Visual code generation tool CRUD + GUI

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.

中文文档
image

[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

select
Tag: laravel-gii

Visit

http: [domain]/gii/model

Instructions

Generate Model

Form description

  1. Table name (support drop-down selection)
  2. Model class name (want to create model classes, including namespaces)
  3. 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.

07656dfd51458bb03cb50825aef4fbc01576222008.jpg

Generate CRUD

The creation of CRUD depends on the previously created model.

This operation will also generate:

  • route
  • controller
  • views

Form description

  1. Controller name (including namespace)
  2. The model class created earlier

85bce766f1a574d97ac931c8b98c29591576222771.jpg

Features

MySQL list loading

Pull list from configured MySQL database
135efc4b0abc7a7baf67793fb8de30901576222494.jpg

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.

image

Route Append

Newly generated pages are automatically appended to the routing configuration file
b58eb0bd955bafea27540d6227e611731576209355.jpg

CRUD background effects

List

Includes comprehensive additions, deletions, and changes

  • List
  • Pagination
  • Retrieve
  • Delete + batch delete
  • Preview
  • Details
  • Edit

a7124e651545e7f462e898ffb37704a41576223115.jpg

delete + batch delete

Cancel button zoom in to prevent accidental deletion

fa926f38e95888fd4a3c3aa055d202f41576223165.jpg

Row Preview

0b2b1603c043aec9b5cee84a17e26f291576223207.jpg

Edit page

bc43b30f13de17e0a2a899a59f647d3a1576223248.jpg

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.

iviewuidocument

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

https://github.com/sunshinev/base-fe

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

本作品采用《CC 协议》,转载必须注明作者和本文链接
《L04 微信小程序从零到发布》
从小程序个人账户申请开始,带你一步步进行开发一个微信小程序,直到提交微信控制台上线发布。
《G01 Go 实战入门》
从零开始带你一步步开发一个 Go 博客项目,让你在最短的时间内学会使用 Go 进行编码。项目结构很大程度上参考了 Laravel。
讨论数量: 1

昂,要不投到翻译专栏,或者发中文版,不然这对小白或者英文不好的人不友好吖。

4年前 评论

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!