Home  >  Article  >  PHP Framework  >  Introduction to the installation steps of laravel5.5 and laravel-admin

Introduction to the installation steps of laravel5.5 and laravel-admin

不言
不言forward
2018-12-21 10:10:206766browse

This article brings you an introduction to the installation steps of laravel5.5 and laravel-admin. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to you.

Configuring laravel-admin

The official tutorial is still no problem, but I also encountered a little pitfall, let’s make a record again

Installing Laravel
Laravel uses Composer to manage dependencies, so make sure Composer is installed on the machine before installation (if it is not installed yet, refer to this document to install it).

Through the Laravel installer

First, install the Laravel installer through Composer:

composer global require "laravel/installer"

Make sure $HOME/.composer/vendor/bin is in the system path (corresponding to Mac The path is ~/.composer/vendor/bin, and the Windows corresponding path is ~/AppData/Roaming/Composer/vendor/bin, where ~ represents the current user's home directory), otherwise the laravel command cannot be called in any path on the command line.

After the installation is complete, you can create a new Laravel application in the current directory with a simple laravel new command. For example, laravel new blog will create a new application named blog and include all Laravel dependencies. . This installation method is much faster than installing through Composer:

laravel new blog

If you have installed an old version of Laravel installer before, you need to update it before you can install the latest Laravel 5.5 framework application:

composer global update

Pass Composer Create-Project

You can also install Laravel applications through Composer's create-project command in the terminal:

composer create-project --prefer-dist laravel/laravel laravel-admin

If you want to download and install other versions of Laravel applications, such as version 5.5, you can use This command:

composer create-project --prefer-dist laravel/laravel laravel-admin 5.5.*。

Note

PHP7.0.30 error is reported, the document says PHP>7.0.0 is enough, but this way of writing seems to be only possible for 7.1.

Introduction to the installation steps of laravel5.5 and laravel-admin

Introduction to the installation steps of laravel5.5 and laravel-admin

## This way of writing is not recognized, just remove it OK. Or upgrade to a higher version of PHP. Pay attention to open the openssl

.env file and follow the regular configuration

Introduction to the installation steps of laravel5.5 and laravel-admin

Be careful not to write the wrong database table name

Then

First make sure laravel is installed and the database connection is set correctly. Then enter the laravel directory and execute

composer require encore/laravel-admin
and then run the following command to publish resources:

php artisan vendor:publish --provider="Encore\Admin\AdminServiceProvider"
This command will generate the configuration file config/admin.php, where you can modify the installed address and database It is recommended to use the default configuration for connections and table names without modifying them.

Then run the following command to complete the installation:

php artisan admin:install
Success:

Introduction to the installation steps of laravel5.5 and laravel-admin

After starting the service, browse Open http://localhost/admin/ and log in using the username admin and password admin.

Error report:

Introduction to the installation steps of laravel5.5 and laravel-admin##Finally Enter config/filesystems.php and add

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

Introduction to the installation steps of laravel5.5 and laravel-adminModify language:

Open config/app.php and modify en -> zh-CN

'locale' => 'zh-CN',

The above is the detailed content of Introduction to the installation steps of laravel5.5 and laravel-admin. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:segmentfault.com. If there is any infringement, please contact admin@php.cn delete