Environment configuration: Docker + Centos8 + PHP8 + Mysql8 + Nginx

Frame: Laravel 8.0

Install by Composer

Install PHP and Composer for the operating system

Install Composer:

1. Download the composer installation file PHP – r “copy (‘ getcomposer.org/installer ‘, ‘composer – setup. PHP);”

PHP –install-dir=/usr/local/bin –filename=composer

PHP -r “unlink(‘composer-setup.php’);

4. View the composer version composer -v

Composer slow speed can be changed ali Cloud mirror

composer config -g repo.packagist composer mirrors.aliyun.com/composer/

Putenv () is disabled in PHP. You can delete putenv() from the disabled list.

Download Laravel now

CD to the corresponding/WWW /wwwroot/ and download the project to the following directory

cd /www/wwwroot/

Create projects in Composer –ignore-platform-reqs Ignores version requirements

composer global require laravel/installer –ignore-platform-reqs

laravel new testapp

Composer require Laravel/UI PHP artisan UI vue — Auth

Update CSS NPM install Development mode NPM run Watch

PHP artisan make: Model News –migration — Resource

Find create_news_table in the database/migrations attribute definition

Table – > id (); table->id(); Table – > id (); table->string(‘title’,200); Table – > text (‘ content ‘); table->text(‘content’); Table – > text (‘ content ‘); table->integer(‘user_id’); Table – > timestamp (‘ createdat ‘) – > nullable (); table->timestamp(‘created_at’)->nullable(); Table – > timestamp (‘ createdat ‘) – > nullable (); table->timestamp(‘updated_at’)->nullable();

php artisan migrate

Route:: Resource (‘/news’, NewsController::class)-> Middleware (‘auth’);

php artisan make:model Employee php artisan admin:make EmployeeController –model=App\Models\Employee $router->resource(’employee’, EmployeeController::class);