Get the App
SLTechnology News&Howtos  ›  Development  › 

How to install Dcat Admin

Shulou Source: shulou.com Published: 2022-06-03 06:07:05 09月19日 Update

This article mainly explains "how to install Dcat Admin". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn how to install Dcat Admin.

Dcat Admin is a background system construction tool based on the secondary development of laravel-admin, which can quickly build a fully functional high-looking background system with very little code. Built-in rich backend commonly used components, out of the box, allows developers to bid farewell to jumbled HTML code, and is very friendly to backend developers.

Effect preview

Use environment

PHP > = 7.1.0

Laravel 5.5.0 ~ 8.*

Fileinfo PHP Extension

Installation

If the composer download is too slow or the installation fails during the installation process, run the command composer config-g repo.packagist composer https://mirrors.aliyun.com/composer/ to replace the composer image with the Aliyun image.

You need to install the laravel framework first, and you can skip this step if you have already installed it.

Composer create-project-- prefer-dist laravel/laravel project name 7.room# or composer create-project-- prefer-dist laravel/laravel project name

After installing laravel, you need to modify the .env file to set the database connection settings correctly.

DB_CONNECTION=mysqlDB_HOST=127.0.0.1DB_PORT=3306DB_DATABASE=dcat-adminDB_USERNAME=rootDB_PASSWORD=

Install dcat-admin

Cd {Project name} composer require dcat/laravel-admin

Then run the following command to publish the resource:

Php artisan admin:publish

In this command, a configuration file config/admin.php is generated, in which you can modify the installation address, database connection, and table name. It is recommended that you do not modify it with the default configuration.

Then run the following command to complete the installation:

Executing this command may report the following error Specified key was too long. 767 bytes. If this error occurs, add the code\ Schema::defaultStringLength (191) to the boot method of the app/Providers/AppServiceProvider.php file, then delete all the data tables in the database and run the php artisan admin:install command again.

Php artisan admin:install

After the above steps are completed, you can configure the web service. Note that you need to point the web directory to the public directory! If you are using nginx, you also need to add pseudo-static configuration to the configuration

Location / {try_files $uri $uri/ / index.php?$query_string;}

After starting the service, open http://localhost/admin in the browser and log in with the user name admin and password admin.

Thank you for your reading, the above is the content of "how to install Dcat Admin", after the study of this article, I believe you have a deeper understanding of how to install Dcat Admin, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Tags: Command configuration data run code name background database file project learning development content developer situation step directory system mirror facet Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information Xiaomi Linux MySQL OPPO Reno