安装laravel-admin产生不了app\Admin文件问题

时间:2022-10-23 14:14:22

困扰很久的问题解决了,呼

httpd.conf文件里我打开了这个,现在还不确定是否是这个问题  今天公司电脑安装,确定了,不是这行的问题,就是字段长度的问题

LoadModule rewrite_module modules/mod_rewrite.so

照样的,php7laravel5.5都下好了,开始安装laravel-admin

先是:composer require encore/laravel-admin "1.5.*"

完了就是:php artisan vendor:publish --provider="Encore\Admin\AdminServiceProvider"

执行完还是没产生app\Admin这个目录,有点慌,继续

再config.php里加入

Encore\Admin\Providers\AdminServiceProvider
不出意外,报错,没有文件,删掉不理,不慌

cmd:php artisan admin:install

执行安装报错:好歹也报错,之前都没报过


[Illuminate\Database\QueryException]
SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes (SQ
L: alter table `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.php\databases.php

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


改成这样,把已经存在的表users删除

再次cmd:php artisan admin:install

Migrating: 2014_10_12_000000_create_users_table
Migrated: 2014_10_12_000000_create_users_table
Migrating: 2014_10_12_100000_create_password_resets_table
Migrated: 2014_10_12_100000_create_password_resets_table
Migrating: 2016_01_04_173148_create_admin_tables
Migrated: 2016_01_04_173148_create_admin_tables
Admin directory was created: \app\Admin
HomeController file was created: \app\Admin/Controllers/HomeController.php
ExampleController file was created: \app\Admin/Controllers/ExampleController.php
Bootstrap file was created: \app\Admin/bootstrap.php
Routes file was created: \app\Admin/routes.php


ok,看见这个我就知道,终于ok了.果然,对应的目录文件产生了

浏览器输入:http://www.laravel.com/admin

没毛病,哈哈