Setting Up a Laravel project as a Front-end Developer
Tags: laravel, frontend, frontenddevelopment
Published: 2018-10-18 09:55:29

---
title: Setting Up a Laravel project as a Front-end Developer
published: true
tags: laravel, frontend, front-end-development
canonical_url: https://medium.com/@mentoudombat/setting-up-laravel-as-a-front-end-developer-9488ded949aa
---

Laravel is often referred to as the “PHP Framework For Web Artisans”. It is an interesting technology to work with as a server-side(back-end) developer but as a front-end developer you can work with it too.

### Requirements

To be able to work on a laravel project, there are some basic requirements:

\* Composer: This is a tool for dependency management in PHP, if you do not have it installed in your computer globally please pause and install it [here](https://getcomposer.org/download/).

\* PHP: It is advisable to root for PHP versions >= 7.0, get it [here](http://php.net/downloads.php) too

- Command Line Interface : No actual recommendation here, anyone you choose is suitable(git bash, CMD, Terminal etc).

#### Introduction

Laravel uses a different view rendering technique called _blading_. Well I will not go into details on that now, because it may bore you out. So let’s get right to it.

**Stage 1** : **Setting up project on local machine**

- **Step 1:** Clone the laravel project to your local machine preferably in your _www_(windows) and _www/html_(linux) folder. you can clone a laravel proejct [here](https://github.com/NedyUdombat/Laravel-frontend-tutorial) for test.
- **Step 2:** Enter into the project directory my running the cd command  
 _cd project-name_
- **Step 3:** Run the composer command to download and install all required laravel dependencies.  
 _composer install_
- **Step 4:** Make a copy of the sample environment file (at this point the project should be open in your text editor)  
 _cp .env.example .env_  
(you should see the new file added through your editor).
- **Step 5:** Generate your unique **_APP\_KEY_**   
 _php artisan key:generate_  
The key will automatically be updated in your environment file in your editor. If it doesn’t you can always copy and paste.

**Stage 2** : **Connecting your database**

- **Step 1:** Go to your _https://localhost/phpmyadmin_, login and create a new database
- **Step 2:** Go to your _.env_ file and edit DB\_DATABASE , DB\_USERNAME and DB\_PASSWORD to match the credentials you just created, where DB\_USERNAME and DB\_PASSWORD are the credentials of your phpmyadmin.
- **Step 3:** Go to your CLI and run php artisan migrate to create the appropriate tables for you in your local database.
- **Step 4:** Run php artisan db:seed seed the tables for you in your local database.
- **Step 5:** Or you can run **step 3& 4** together as _php artisan migrate --seed_ to create the appropriate tables and seed them in your local database.

**Stage 3** : **Food is ready**

The project is ready to be served in your local machine. To do this run **php artisan serve** to serve the project at _localhost:8080_ or _127.0.0.1:8000_ .

To alternatively serve in through another port run **php artisan serve --port=port no** . For instance if port 8000 is occupied you can run it on 8080 like this **php artisan serve --port=8080** .

Visit _127.0.0.1:8080_ or _127.0.0.1:port no_ to see your project up and running

There are so many things I would love to add to this, but let’s keep it short and concise. In the next article, I will talk about **_Working with Laravel as a Front-end Developer ._**

I hope this was simple and straight forward, If you have any corrections or additions please feel free to drop a comment.