Giter Site home page Giter Site logo

Daimakuai

Build Status StyleCI Scrutinizer Code Quality Packagist Latest Stable Version Total Downloads Awesome Laravel Join the chat at https://gitter.im/daimakuai/daimakuai

daimakuai 是一个可以快速帮你构建后台管理的工具,它提供的页面组件和表单元素等功能,能帮助你使用很少的代码就实现功能完善的后台管理功能。

Demo 账号/密码:admin/admin

截图

PC端访问

daimakuai

手机端访问

daimakuai

安装

首先确保安装好了 Composer Laravel,并且数据库连接设置正确,如果没有安装,请访问安装Laravel进行安装。

Laravel 5.5

composer require jblv/daimakuai "dev-master" -vvv

示例如:

> 修改composer为国内镜像,加速下载
composer config -g repo.packagist composer https://packagist.phpcomposer.com

composer create-project laravel/laravel=5.5.* bbcshop -vvv

composer require jblv/daimakuai "2.0" -vvv

注意:
> bt宝塔服务器需要先关闭以下几个禁用函数: putenv  pcntl_signal proc_open


在`config/app.php`加入`ServiceProvider`:

Jblv\Admin\Providers\AdminServiceProvider::class


然后运行下面的命令完成安装:

Laravel 5.5

> 安装前,对.env里的数据库等信息进行修改

php artisan vendor:publish --provider="Jblv\Admin\AdminServiceProvider"



php artisan admin:install

启动服务后,在浏览器打开 http://localhost/admin/ ,使用用户名 admin 和密码 admin登陆.

宝塔部署注意

1、 伪静态增加: location / {
try_files $uri $uri/ /index.php$is_args$query_string;
}

2、网站目录去掉 防跨站攻击(open_basedir)

3、网站目录 选择根目录,运行目录选择 public

默认配置

安装完成之后,daimakuai所有的配置都在config/admin.php文件中。

使用文档

目录结构

安装完成之后,后台的安装目录为app/Admin,之后大部分的后台开发编码工作都是在这个目录下进行。

app/Admin
├── Controllers
│   ├── ExampleController.php
│   └── HomeController.php
└── routes.php

app/Admin/routes.php文件用来配置后台路由,详细使用请阅读路由配置

app/Admin/Controllers目录用来存放后台路由器文件,该目录下的HomeController.php文件是后台首页的显示控制器,ExampleController.php为实例文件。

快速开始

Laravel自带的users表举例,表结构为:

CREATE TABLE `users` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `email` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `password` varchar(60) COLLATE utf8_unicode_ci NOT NULL,
  `remember_token` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  PRIMARY KEY (`id`),
  UNIQUE KEY `users_email_unique` (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci

对应的数据模型为文件 App\User.php

daimakuai可以通过使用以下几步来快速生成users表的CURD操作页面:

1.添加路由器

使用下面的命令来创建一个对应App\User模型的路由器

php artisan admin:make UserController --model=App\\User

上面的命令会创建路由器文件app/Admin/Controllers/UserController.php.

2.添加路由配置

daimakuai的路由配置文件app/Admin/routes.php里添加一行:

$router->resource('users', UserController::class);

3.添加左侧菜单栏连接

打开http://localhost:8000/admin/auth/menu,添加对应的menu

然后就能在后台管理页面的左侧边栏看到用户管理页面的链接入口了。

4.创建表格表单

剩下的工作就是构建数据表格和表单了,打开 app/Admin/Contollers/UserController.php,找到form()grid()方法,然添加构建代码,更多详细使用请查看model-gridmodel-form

其它

daimakuai 基于以下组件或者服务:

交流

QQ群:14086762

License

daimakuai is licensed under The MIT License (MIT).

Daimakuai's Projects

bitcoin icon bitcoin

Bitcoin Core integration/staging tree

daimakuai icon daimakuai

`daimakuai` 是一个可以快速帮你构建商城、cms、小程序的后台管理的工具,它提供的页面组件和表单元素等功能,能帮助你使用很少的代码就实现功能完善的后台管理功能。

gaussianavatars icon gaussianavatars

Official repo for "GaussianAvatars: Photorealistic Head Avatars with Rigged 3D Gaussians"

lz-h5-edit icon lz-h5-edit

随心秀(react版h5微场景编辑器),一款类似【易企秀】【兔展】的H5微场景编辑器

mind-map icon mind-map

一个还算强大的Web思维导图。A relatively powerful web mind map.

shadoweditor icon shadoweditor

Cross-platform 3D scene editor based on three.js, golang and mongodb for desktop and web. https://tengge1.github.io/ShadowEditor-examples/

sphinx icon sphinx

Main repository for the Sphinx documentation builder

template icon template

Share 100 templates HTML5 CSS3 for developer or beginner

trafficmonitor icon trafficmonitor

这是一个用于显示当前网速、CPU及内存利用率的桌面悬浮窗软件,并支持任务栏显示,支持更换皮肤。

uncolored icon uncolored

(Un)colored — Next generation desktop rich content editor that saves documents with themes. HTML & Markdown compatible. For Windows, OS X & Linux. — http://n457.github.io/Uncolored/

vzl icon vzl

💠 DOT Language Live Editor (GraphViz)

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.