Laravel Installation : Creating first laravel project (Part 1)

 

Hi they, in our previous tutorial we learn about the basic of laravel, I believe by now you know what laravel is, if you missed that series click here to check it out. In this series we will be creating our first laravel application. We will cover area like;

  • Installation
  • Environment configuration
  • Serving our application and
  • Application structure

Then in our next series we begin crating a CRUD system. So let raid into laravel installation. 

NOTE: In this tutorial we will be running our project on a Linux Operating system.


Before we install laravel we need to ensure we have Composer, MySQL installed on our system. Laravel uses composer to manage dependencies. So we will need to install composer first before installing laravel.


Composer
Composer is a tool which includes all the dependencies and libraries. It allows us to create our project. For guide on how to install composer on your system visit https://getcomposer.org/download/

Now let install Laravel.
Create a new directory (folder) anywhere in your system where you want your new Laravel project to be. After that, switch your terminal into that directory you have just created and type the following command there to install Laravel. In this example we are going to create an application called estore so replace with yours.


composer create-project –-prefer-dist laravel/laravel estore

The above command will create a project called “estore” for us. After installation simply switch your terminal directory into the estore directory. 

Now let serve the application by simply typing the below command from the estore directory:


php artisan serve

This will serve your application on http://localhost:8000 or any other port confirm yours from the terminal. If you hit up the URL above your show see a similar screen below

So far we have install composer, install laravel and serve our project, now let look at some configurations.


Environment Configuration
Let look at some of the configurations. If you check the project folder you will see a file called .env this is where all our configurations parameters are, open up the file. This is where you set things like application name, database, host, etc. In our next series on CRUD system will use this file to setup our database.
By default, the .env file includes following parameters:


.env variables 



In our next tutorial we will look at Laravel Application structure.

Post a Comment

0 Comments