Laravel is being used on very large scale now-a-days , 9 out of 10 php developers are using Laravel . In this article we will also see howto install and setup Laravel.
Laravel is fully featured MVC pattern framework , most of the things handled by laravel . Frameworks is just a tool to increase our development time and code quality . We also have to do few things in order to create our CRUD application.
So lets get started , before we hit to the code part lets analyse what we need to start writing any code. We need two most important tools database server and composer . For the database purpose I am using XAMPP which comes with mysql and phpmyadmin .
if you dont have these two things please install it before we go further . To install composer you can follow these links according to your Operating system .
Now then , I am using Laravel 7.x (latest) for this article . To work with laravel 7.x you must have php 7.2.5 + version installed according to laravel documentation . Documentation .
Install and setup laravel
To install laravel composer is used . Now open your teminal or cmd where you want to create this project ( It is not required to create laravel project in “htdocs” folder , you can create in any drive and directory ). In your terminal type the following command .
composer create-project --prefer-dist laravel/laravel yourProjectName
Alternatively you can also install laravel installer globally so that you dont have to create project with composer every time . Lets see how to do that , Using following command you can install laravel globally in your system. This is one time command .
composer global require laravel/installer
Once you ran above command now your system will have laravel installer . Type the following command to create new project using laravel installer .
laravel new yourProjectName
Well then now , lets proceed I am going to use first approach to create new laravel application .
Once the installation is finished , change your directory to newly created “yourProjectName” directory .
Now we are ready to hit the code part . Open your favourite code editor and start coding .