So why Laravel? Well straight answer is to be a good developer and lean clean coding you can learn Laravel. It helps php developers to write less codes and do more and who don’t want an easy life. Best way to learn is to read Laravel Documentation and if you face any problem like me you can get help from StackOverflow.
I prefer to learn the basics and architecture first and do learning level wise project. Projects help to learn faster and gives you the ability too finds errors and debug them.
Laravel is an Open Source MVC framework build using php. MVC stands for Mode View Controller . The thing user can see in website (front-end) is View. All the HTML, CSS, Js will be in View Section. The section where all the logic, functions and all the requests from the users lies in. You can access all of it in Controller section. It comes with default controller. To implement your logic we have to create our own controller. Model is like brain/ storage, we can save all the data in model sections. By using controller we manipulate Model and show the updates to user using View.
Laravel comes with some requirements and few dependencies which are easy to get and can be get from any distributions like Linux, OSx and Windows.
First thing first. We have to install Composer which comes with all the required dependencies. I am using windows machine and I will show all the procedure in Windows OS.
Go to Composer website, download and install this dependency manager for Laravel. Composer requires php installed in your machine. For php installation, you can download from php website or you can install WAMP or XAAMP and then when ccoomoser wants php loation show the php folder.
After the completion of the install, check it’s installed or not using windows cmd prompt. Type
composer in cmd prompt and if you see like this image then it’s installed.
Let’s install using the installer. Open cmd and type
composer global require "laravel/installer".
Installer will instantly install it and type
laravel which will show the installer version.
Now we are good to install our first project. Navigate to the folder where you want to keep your project. Open cmd prompt (Ctrl+Shift+Mouse Right Button) there and type
laravel new project_name. It will take some time to install required files (time depends on your internet speed).
It’s time to check via browser whether Laravel installed or not. Open cmd prompt (Ctrl+Shift+Mouse Right Button) in the project directory and type
laravel artisan serve.
Browse to the given URL and if you see like mine then you have successfully setup your project.