Javatpoint Logo
Javatpoint Logo

How to install Laravel on MacOS

Introduction

Laravel is a free and open source web framework written in PHP. It is created by Taylor Otwell. It follows MVC development approach. As of March, 2015, Laravel is regarded as one of the most popular PHP based framework. It provides advanced alternative to CodeIgniter which is not intended to built-in user authorization. In this tutorial, we will install Laravel on MacOS.

Prerequisites

  1. MacOS
  2. XAMPP
  3. Login as an administrator on terminal
  4. PHP >= 7.0.0
  5. OpenSSL PHP Extension
  6. PDO PHP Extension
  7. Mbstring PHP Extension
  8. Tokenizer PHP Extension
  9. XML PHP Extension
  10. login as a root user into the terminal
  11. Composer

Installation

Installation includes following steps.

1) Verify composer

Verify that composer is installed globally on the system by typing composer on terminal.

How to install Laravel on MacOS

2) Install Laravel with Composer

A simple command needs to be executed in order to install Laravel on MacOS.

How to install Laravel on MacOS

3) Edit bash profile

To run Laravel globally on terminal, we need to edit bash profile. Type the following command to open bash-profile in vieditor.

And add the following line to the file.

Source the file by using following command.

4) Create new Application

Now, we can run Laravel globally on our terminal. We need to run following command for this purpose.

How to install Laravel on MacOS

This will create an application named as mylaravel inside the home directory of current user.

5) Start the server

Laravel provides its own server which needs to be started in order to access Laravel on localhost. First, we need to change the directory by typing cd mylaravelon terminal and then Run the following command to start the server.

How to install Laravel on MacOS

6) Access on localhost

We can just simply type localhost:8000 to access Laravel on browser.

How to install Laravel on MacOS

Hence, we have installed and get started with Laravel.







Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA