Download the PHP package skyyouare/laravel-gii without Composer

On this page you can find all versions of the php package skyyouare/laravel-gii. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-gii

laravel-gii 可视化代码生成工具 CRUD +GUI

Latest Version on Packagist Total Downloads Build Status

Laravel Gii 参考sunshinev/laravel-gii,使用laravel7 + vue + elemnt-ui 架构,api使用resftul api,前后端分离,项目代码使用php artisan vendor:publish发布后,不依赖扩展本身,全部部署到项目各目录下,可根据需求灵活修改

[TOC]

demo

  1. gii地址:http://49.233.68.29/gii/model
  2. 访问地址(例):http://49.233.68.29/alarmlog/list

    原理

  3. 通过解析MySQL的数据表结构,来提取字段、以及类型,并填充到stub模板。
  4. 生成对应的Model、Observer、Controller、View、Route等相关项目文件。
  5. 根据MySQL表结构生成Model
  6. 根据Model生成Controller

注意

因为是解析MySQL的表结构,并且根据字段生成模板,所以目前生成的Model类时只支持MySQL, MySQL表结构请保证id,created_at,updated_at三个字段必须存在。

安装

扩展包

请先安装laravel7(其他版本未测试)

Via Composer

发布

访问

在发布完成后,已经进行了路由的注册,可以通过下面的路由访问Gii页面,请确认配置好数据库(否则会报错),网站域名(ip)等

操作说明

生成Model模型

表单说明

  1. MySQL table name:选择表名称
  2. Model name:自动生成并选择mode名称,可以选择预定义的命名空间 可以修改config/gii.php增加或修改model_namespaces,下拉选择按配置排序
  3. Parent class name:自动选择模型继承的父类,可调整config/gii.php文件中base_model_defaults配置就行修改
  4. select fileds:需手动选择需要生成下拉框的文件,字典需手动修改 生成model的 get_dicts方法
  5. Primary key:主键,默认选择第一个字段
  6. Create at:选择创建时间字段,可以修改config/gii.php文件create_at_defaults进行调整
  7. Update at:选择更新时间字段,可以修改config/gii.php文件update_at_defaults进行调整

生成的文件列表,蓝色代表全新文件,红色代表已有文件但是存在不同,白色代表已有文件。

比如指定生成的Model命名空间为App\Models\Admin\AlarmLog,那么生成的目录结构为:

通过上面的结构,我们可以发现命名空间与目录之间的关系。

images

生成CRUD

CRUD的创建,需要依赖之前创建的模型。

该操作会同时生成:

表单说明

  1. Model:选择model,可配置config/gii.php文件model_base_path获取加载下拉列表目录
  2. Controller namespace:选择命名空间,可修改config/gii.php文件create_at_defaults进行调整controller_namespaces
  3. 自动生成文件名

如果指定命名空间的类为App\Http\Controllers\Admin,控制器为AlarmLogController ,以及关联的Model为App\Models\Admin\AlarmLog,那么生成的目录结构为:

以及生成的视图文件

images

如何访问CRUD?

注意:路由是追加的,请勿多次生成 CRUD的路由会自动添加到路由文件中,根据Controller的命名空间App\Http\Controllers\Admin\AlarmLogController会生成如下的路由,所以请直接访问路由

CRUD后台效果

列表页

包含全面的增删查改功能

images

快捷搜索

images

添加页面

images

编辑页面

images

详情

images

License

MIT. Please see the license file for more information.


All versions of laravel-gii with dependencies

PHP Build Version
Package Version
Requires illuminate/support Version ~5|~6|~7
sebastian/diff Version ^3.0
doctrine/dbal Version ^2.10
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package skyyouare/laravel-gii contains the following files

Loading the files please wait ....