daimakuai
is a tool that can quickly help you build backend management. It provides functions such as page components and form elements, which can help you implement fully functional backend management functions with very little code.
Demo account/password:admin/admin
First, make sure Composer
Laravel
is installed and the database connection is set correctly. If it is not installed, please visit Install Laravel to install it.
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`:
JblvAdminProvidersAdminServiceProvider::class
然后运行下面的命令完成安装: Laravel 5.5 > 安装前,对.env里的数据库等信息进行修改 php artisan vendor:publish --provider="JblvAdminAdminServiceProvider" php artisan admin:install
After starting the service, open http://localhost/admin/
in the browser and log in using the username admin
and password admin
.
1. Pseudo-static addition: location / {
try_files $uri $uri/ /index.php$is_args$query_string;
}
2. Remove the anti-cross-site attack (open_basedir) from the website directory
3. Select the root directory for the website directory and public for the running directory.
After the installation is complete, all daimakuai
configurations are in the config/admin.php
file.
quick start
Routing configuration
Menu configuration
Show layout
Data model table
Data model form
Image/File Upload
form component management
components
sheet
form
Box
information box
tab
Slide album
Collapse container
Data chart TODO
Permission control
After the installation is completed, the background installation directory is app/Admin
, and most of the subsequent background development and coding work will be performed in this directory.
app/Admin ├── Controllers │ ├── ExampleController.php │ └── HomeController.php └── routes.php
app/Admin/routes.php
file is used to configure background routing. Please read routing configuration for detailed usage.
The app/Admin/Controllers
directory is used to store background router files. The HomeController.php
file in this directory is the display controller for the background homepage, and ExampleController.php
is an example file.
Using the users
table that comes with Laravel
as an example, the table structure is:
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
The corresponding data model is the file AppUser.php
daimakuai
can quickly generate the CURD
operation page of the users
table by using the following steps:
Use the following command to create a router corresponding to the AppUser
model
php artisan admin:make UserController --model=AppUser
The above command will create the router file app/Admin/Controllers/UserController.php
.
Add a line to daimakuai
’s routing configuration file app/Admin/routes.php
:
$router->resource('users', UserController::class);
Open http://localhost:8000/admin/auth/menu
and add the corresponding menu
Then you can see the link entrance to the user management page in the left sidebar of the background management page.
The remaining work is to build data tables and forms. Open app/Admin/Contollers/UserController.php
, find form()
and grid()
methods, and then add the construction code. For more detailed usage, please see model-grid and model- form.
daimakuai
is based on the following components or services:
Laravel
AdminLTE
Datetimepicker
CodeMirror
font-awesome
moment
Google map
Tencent map
bootstrap-fileinput
jquery-pjax
Nestable
noty
X-editable
bootstrap-number-input
QQ group:14086762
daimakuai
is licensed under The MIT License (MIT).