Redis cache must be used, file and database cache do not support tags()
Windows redis download address: http://pan.baidu.com/s/1i56thcD
Quickly use Redis cache and Redis cache in lv5: https://laravel-china.org/topics/877
Please purchase the front-end template yourself. If there is any infringement, please contact the author.
User permissions role extension: zizaco/entrust
redis extension: predis/predis
Select the activation extension in the menu: hieu-le/active
Database extension: Array format returned by prettus/l5-repository
query
Architecture dependency description: http://oomusou.io/laravel/laravel-architecture/
jQuery DataTables API for Laravel: yajra/laravel-datatables-oracle
Log reading extension: arcanedev/log-viewer
app log configuration 'log' => env('APP_LOG', 'daily'),
Image processing extension: intervention/image
PHP Redis extension
PHP cURL extension
PHP OpenSSL extension
PHP fileinfo is needed to expand the material management module
http://datatables.club/
https://datatables.yajrabox.com
Inline editing: https://vitalets.github.io/x-editable/docs.html
https://github.com/DukeAnn/Laradmin/blob/master/UpdateLog.md
1. Pull the code to local,
2. composer install
3. Set the .evn
configuration file to connect to the database and default email sending server, set APP_URL=http://laradmin.app
, and execute php artisan key:generate
to generate the key.
4. Run migration and population
5. php artisan migrate --seed
Installation completed
Demo address: http://admin.amyair.cn
Test account: Register directly in the upper right corner
1. The permission management extension does not use the l5 database extension.
2. The background left menu automatically corresponds to the selected state. All routes on the website must be named, and the route naming prefixes under the same menu option are consistent, such as: admin.index
, admin.create
, admin.show
, admin.edit
, etc., resource type Routes are automatically named. The route names ending in index are all displayed on the left menu in the background. Use route();
when the program makes a directional jump. If the permissions of the subcategories under the top-level menu are prohibited, please add the user permissions of the top-level menu and set it so that the user has no permissions and the menu will not be displayed. The background menu display principle is to query user permissions through the menu uri. If the permission is set, verify whether there is permission. If not, it will not be displayed. If it is not set, there will be no permission requirement by default. The uri set for menu items with subclasses will not be output in html, but will only output a JavaScript:; so it will not report an error if it is set to a non-existent route name. The uri without submenu will be parsed using the route() function. If If the route name does not exist, an error will be reported.
3. The breadcrumbs in the page are written into the language package. The name in the language package corresponds to the value of Route::currentRouteName();
(the route name). The breadcrumbs are generated by service injection AppPresentersAdminCrumbsService
, which is not defined in the language package. Directly displays the key value of the language pack.
4. Closure routing cannot be used for routing. The route must be named otherwise Route::currentRouteName();
will not take effect, and all permission verification and menu jumps use the routing name.
5. Permission authentication uses permissions to bind the route name and verify it in the app/Http/Middleware/CheckPermission.php
middleware. Form submission permissions are verified in app/Http/Requests
. If the route name is not bound to permissions, there will be no permission restrictions. .
6. When adding a menu in the background, it is not allowed to add an existing route name, otherwise the website will crash. Because the menu will be displayed on the left after adding it, but if the route name does not exist, it cannot be parsed and an error will be reported. If you accidentally make a mistake, execute php artisan cache:clear
to clear the cache and delete the wrong data inserted in the database! Just refresh the page.
###json format is common to API
{
"code" : 0 ,
"url" : http://...
"message" : " ... " ,
"errors" : [
{
"code" : 10000 ,
"field" : " user " ,
"message" : "用户 不存在。 "
}
],
"pagination" : {
"total" : 10 ,
"per_page" : 10 ,
"current_page" : 1 ,
"last_page" : 1 ,
"from" : 1 ,
"to" : 10
},
"data" : {
...
}
}
####json return value description code
processing result status code, successful is 0, required
The jump address after url
is processed successfully. It can be left blank.
Notification information of completion of message
processing, optional
errors
error information
Pagination information requested by pagination
Data information requested by data
errors
and data
cannot exist at the same time
Return to use
return response(['code' => -1, 'message' => '账号或者密码错误'], 400);
automatically converted to json
or
return response()->json(['code' => -1, 'message' => '账号或者密码错误'], 400);
AJAX analysis
var settings = {
type : "POST" ,
data : { } ,
url : url ,
dataType : "json" ,
success : function ( data ) {
if ( data . code == 0 ) {
window . location . href = data . url ;
}
} ,
error : function ( XMLHttpRequest ) {
$ ( '#login-error' ) . show ( ) ;
if ( XMLHttpRequest . responseJSON . code == - 1 ) {
$ ( '#login-error-message' ) . text ( XMLHttpRequest . responseJSON . message ) ;
} else {
$ ( '#login-error-message' ) . text ( "请填写邮箱和密码" ) ;
}
} ,
headers : {
'X-CSRF-TOKEN' : $ ( 'meta[name="csrf-token"]' ) . attr ( 'content' )
}
} ;
$ . ajax ( settings )
php artisan make:entity name
, automatically creates model files, database migration files, two files under the Repository, Providers files, optionally generates Presenter, Validator, and Controller files
php artisan make:repository name
, generate model files, database migration files, and two files under Repository