Laravel has evolved a lot in the past few months. If you had to migrate from a
Laravel 4.0 application to
Laravel 5.* you would know the difference. It is very powerful framework now. It is my favorite PHP framework when comes to personal projects(PS: I still use
Symfony for quite a lot of work that I do for my clients if the language chosen is PHP).
Here we will discuss how to install and get started with
Before we proceed further please make sure that your
PHP installation is above
5.6.4 and you have
composer installed. You will also need to have the following extensions enabled:
The recommended method is to install via the
Laravel installer. However, I prefer creating
Laravel projects using composer.
Open the terminal and type:
This will create a
Laravel project and its dependencies.
Once you have done this, you can go to the directory
my_project and issue:
http://localhost:8080 and you can see your
If you are trying to create a simple project or just experimenting
Laravel you can simply use the
artisan serve method we discussed above. However, if you wish to create a professional development environment for developing a
Laravel based application then you should use
Homestead. So, let’s set that up. However, before you proceed to install
Homestead, please make sure that you have
You can install
Homestead by simply issuing:
I prefer a different approach. To have the latest
Homestead box, clone the latest master branch from
github. You can do this by:
Once you have cloned the code, go to the
Homestead directory and issue
This will set up
Homestead for you.
Homestead.yml in the
Homestead directory and update the following values:
This assumes that you have created the
Laravel project in your home directory and you are using
virtualbox as the virtualization provider for your
Now edit your
http://project.app - voila! Your application is up and running.
Laravel Directory Structure
The directory structure of
Laravel is straight forward. As you are a beginner you need to focus only on the following directories:
app : All core files related to the application go here. This includes
routes: All the routing information associated with your application should be placed under this directory.
resources: This is the place for all
public: This is a publicly accessible directory.
app directory you need to focus only on
Controllers to get you started.
As mentioned before, all the routing for the application is done using the files under the
routes folder. Here, as you are a beginner, you need to focus only on the
Laravel is a beautiful framework as far a web developer is concerned. One of the main features of
Laravel and one that makes it beautiful is the
artisan command that comes with it. Using this you can create
jobs etc. You can even create custom commands by extending it (Please note that you are essentially extending
If you wish to create a new controller you can do that by issuing:
Now imagine you want to create a controller that needs to handle rest operations. You can do that by running:
I will soon be adding an article that explains how to create your first