Laravel-admin安装

1.安装LARAVEL5.6; 切换至WEB根目录,右键"在此处打开CMD窗口"

composer create-project --prefer-dist laravel/laravel 项目名称

2.切换至
项目名称 config/config.php 修改数据库配置
打开
项目名称/.env 修改数据库配置
3.安装laravel-admin 命令路径切换至
项目名称
composer require encore/laravel-admin "1.5.*"

继续
发布资源:
php artisan vendor:publish --provider="Encore\Admin\AdminServiceProvider"

建议都是用默认配置不修改。
继续:
php artisan admin:install

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

如果出现如下错误:
Illuminate\Database\QueryException : SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 byt
es (SQL: alter table `cn_users` add unique `users_email_unique`(`email`))
  PDOException::("SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes")
 

字段长度问题,修改数据库配置文件 项目名称\config\databases.php

'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
'strict' => true,
'engine' => 'InnoDB',

继续 

php artisan admin:install
well done!


猜你喜欢

转载自www.cnblogs.com/thisdo/p/9237176.html