Environment:

Operating system: Mac OS Bigsur

Server: centos 8 (built by Docker)

Environment: PHP8 + Mysql8 + Nginx + composer + NPM

Software tools: VScode, iTerm

Configure the Laravel environment

Connect to centos over SSH

Enter the following command: composer global require laravel/installer

Enter the composer -v command to ensure that the composer has been successfully installed

Install Laravel globally

Enter the following command: composer global require laravel/installer

Add a variable

Type the command: export PATH = “. $PATH: ~ / config/composer/vendor/bin”

Enter the laravel -v command to ensure that the installation is successful

Create a new project with the laravel command

Enter the laravel new test command

Enter the command: composer install –ignore-platform-reqs

Folder storage assigns 777 read and write permissions

Enter the chmod -r 777 storage command

Enter the PHP artisan key:generate

Enter the address: http://127.0.0.1

It can be seen that the Laravel front-end has been built.

Configure the Laravel background, laravel-admin

Create a new database, find the.env file in the project directory, and configure the database.

CD to Laravel project, Laravel-admin needs to build on laravel foundation.

Enter the following command: composer require encore/laravel-admin –ignore-platform-reqs

Download the background project using Composer

Enter the following command: PHP artisan vendor:publish –provider=”Encore Admin AdminServiceProvider”

Configure background files

Enter the PHP artisan admin:install command

Find the project directory, /config/filesystems.php

/ / add code 'admin' = > [' driver '= >' local ', 'root' = > public_path (' upload '), 'visibility' = > 'public', 'url' => env('APP_URL').'/public/upload/', ],Copy the code

Create a new folder upload under the public directory

To set the interface language to Chinese, change the locale => en in the config/app. PHP file to locale => zh-cn.