How to install Laravel on MacOS
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.
Installation includes following steps.
1) Verify composer
Verify that composer is installed globally on the system by typing composer on terminal.
2) Install Laravel with Composer
A simple command needs to be executed in order 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.
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.
6) Access on localhost
We can just simply type localhost:8000 to access Laravel on browser.
Hence, we have installed and get started with Laravel.