composer安装laravel-admin后台框架
1. 安装composer
2. 环境需求该软件包需要PHP 7+和Laravel 5.5
3. 安装Laravel输入命令:composer create-project --prefer-dist laravel/laravel (可选项目名) “5.5.*”
4. 修改配置文件.env链接数据库
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=test
DB_USERNAME=root
DB_PASSWORD=123456
5. 安装admin输入命令:composer require encore/laravel-admin
6. 配置环境admin环境,输入命令:php artisan vendor:publish --provider="Encore\Admin\AdminServiceProvider"
7. 执行安装,输入命令:php artisan admin:install
8. 配置文件在config/filesystems.php中添加
'admin' => [
'driver' => 'local',
'root' => public_path('upload'),
'visibility' => 'public',
'url' => env('APP_URL').'/public/upload/',
],
9. 在public目录新建upload目录
10. php开启openssl扩展
11. nginx指向public配置
location / {
try_files $uri $uri/ /index.php?$query_string;
}