当前位置:网站首页>完整安装 Laravel-Admin 框架
完整安装 Laravel-Admin 框架
2022-08-02 03:26:00 【陌潇】
1、Laravel安装
Laravel 使用 Composer 来管理项目依赖。因此,在使用 Laravel 之前,请确保你的机器已经安装了 Composer。
通过 Composer 创建项目
composer create-project --prefer-dist laravel/laravel blog #blog是项目名称可以自己随意修改安装成功之后确保数据库已经连接成功

安装成功之后就可以安装laravel-admin
4、Laravel-admin安装
#1:
composer require encore/laravel-admin:1.* #用composer安装laravel-admin 1.*代表版本
#也可以使用
composer require encore/laravel-admin
#2:
php artisan vendor:publish --provider="Encore\Admin\AdminServiceProvider" #发布资源
#3:
php artisan admin:install #安装laravel-admin并进行数据库迁移5、常见问题
- php artisan admin:install
运行这个命令的时候,如果遇到了下面的错误:
SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes (SQL: alter tableusersadd uniqueusers_email_unique(email))
在app\Providers\AppServiceProvider.php添加默认值
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Schema; //add fixed sql
class AppServiceProvider extends ServiceProvider
{
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
Schema::defaultStringLength(191); //add fixed sql
}
/**
* Register any application services.
*
* @return void
*/
public function register()
{
//
}
}
至此已经可以运行项目
修改界面的语言:
config 下的 app.php 修改
'locale' => 'zh-CN',如果zh-CN不起作用的话,可以看一下自己下载的版本对应的文件名是什么。

记得修改配置文件之后需要更新缓存。更新缓存:
php artisan config:cache左侧导航栏,由于数据库 admin_menu** 里面存的是英文字符 **,所以需要个人手动修改。

- 在添加或者修改的时候报错,解决方法 在 config/filesystems.php 中添加:

'admin' => [
'driver' => 'local',
'root' => public_path('upload'),
'visibility' => 'public',
'url' => env('APP_URL').'/upload',
],左侧菜单栏默认展开
打开config/admin.php,修改layout,
去掉sidebar-collapse,留下sidebar-mini

'layout' => ['sidebar-mini'],边栏推荐
- 云安全笔记:云原生全链路加密
- Basic use of v-on, parameter passing, modifiers
- Warzone: 3 (Exogen) vulnhub walkthrough
- CSRF (Cross Site Request Forgery)
- (6) Design of student information management system
- Alibaba Cloud MySQL 5.7 installation and some major problems (total)
- Activity
- Introduction to PHP (self-study notes)
- SQL注入(7)
- Scrapy crawler encounters redirection 301/302 problem solution
猜你喜欢

hackmyvm: may walkthrough

财产清查概述、 全面清查的情况、局部清查的情况、财产清查的方法、财产清查结果的处理

What are the killer super powerful frameworks or libraries or applications for PHP?

链动2+1模式开发系统

mysql 原生语句点滴学习记录

hackmyvm-random walkthrough

(2) Sequence structures, Boolean values of objects, selection structures, loop structures, lists, dictionaries, tuples, sets

hackmyvm: kitty walkthrough

Praying: 1 vulnhub walkthrough

最简单的FRP内网穿透教程
随机推荐
Command Execution Vulnerability
一次代码审计的笔记(CVE-2018-12613 phpmyadmin文件包含漏洞)
学IT,找工作——反转链表
Anaconda报错:An unexpected error has occurred. Conda has prepared the above report 解决办法
Activity
php函数漏洞总结
laravel-admin 线上访问项目,一直重定向到登录页面
挖矿是什么意思?矿工都做了什么?
解密:链动2+1的商业模式
hackmyvm: kitty walkthrough
How to determine the direction based on two coordinate points on the map
DNS详解
Solve the problem that the 5+APP real machine test cannot access the background (same local area network)
hackmyvm: again walkthrough
Cookie is used to collect the admin privileges CTF foundation problem
GreenOptic: 1 vulnhub walkthrough
PHP实现搜索框的自动反查提示
(6) Design of student information management system
记账凭证的种类、记账凭证的基本内容、记账凭证的填制要求、记账凭证的审核
(1) the print () function, escape character, binary and character encoding, variables, data type, the input () function, operator