Laravel 5.8 Installation

In this tutorial you will learn about the Laravel 5.8 Installation and its application with practical example.

Laravel 5.8 Installation

Download and install Laravel 5.8 using the below command. Make sure you have composer installed.

Now, lets switch to the project directory and start the development server using following artisan command –

Now, open the following URL in browser to see the output –

http://localhost:8000/

Output:-

laravel-5-7-crud-tutorial-with-example-2

In case if you get RuntimeException No application encryption key has been specified error, please follow instruction given below to generate application key –

Generate Application Key

Open terminal and switch to the project directory and run the following command to generate application key and configure cache.

Connecting Laravel with MySQL Database

In order to connect your laravel application to a MySQL database. Lets create a MySQL database set database credential in application’s .env file.

.env

Migrations

Before we run “php artisan migrate” command, location the file “app/Providers/AppServiceProvider” file, and add following line of code in the top of the file

and inside the boot method set a default string length as given below –

So this is how your “app/Providers/AppServiceProvider” file looks like –

After installing laravel, some default migration files are created inside “database/migrations” directory. Now, lets run the “php artisan migrate” command for creating default create users table and password reset table.

Recommended:-  Laravel 6 Create REST API with jwt Authentication

Restart Development Server

Restart the development server using following artisan command –

Now, visit the following URL in browser to see the output –

http://localhost:8000/

Output:-

laravel-5-7-crud-tutorial-with-example-2

In this tutorial we have learn about the Laravel 5.8 Installation and its application with practical example. I hope you will like this tutorial.