Laravel
PHP’s MVC framework, say a popular one too
It is developed by Taylor Otwell, thank him for making our web development somewhat easier, its current version is 8.x
What you need before dive into it?
Cool :)
basics of HTML, CSS, JS and PHP is enough (I hope you know these at least or learn them first)
I am sure developing web application using Laravel is easy (hope so) and interesting too :)
Laravel is a PHP Framework
What is Framework?
Simply, a set of pre-developed files that makes our development easier and faster, we develop->code our ideas on top of these files...
Why we need Framework?
Reduces development time, avoid developing simple components too, then finally we can get relief from scratching our head for managing data flow between multiple files ( but of course frequently we need to scratch our head for logical reasons :| )
If you feel you are creative - you have patience - eager to explore then for a sure Laravel thrills you...
Lets Begin,
Laravel follows a MVC architecture ...
What is MVC?
- MVC is an architecture where Database Operations - Business Logic - View (visual representation) were kept separately.
- It makes code readability easier
- also makes our work easier too :)
MVC - Model - View - Controller
- Model - Place to write all database related code
- View - Where we write UI related code
- Controller - Holds an actual logical part, acts as a mediator between Model and View
System Requirements
.
.
.
.
.
.
.
.
.
.
.
.
.
I hope you were done with installation :)
then to run server
If you are using WAMP
you can observe the transition status of WAMP server
Starting/Error -
Partially Completed -
Started Successfully -
If you are using XAMPP
then within its interface start Apache and MySQL
then open browser hit http://localhost
if a page related
to WAMP/XAMPP loads properly then it is clear that server started properly else there might be some problems with your system
open cmd - a command prompt and enter composer
if it shows like this
it justifies that composer got installed successfully
Got Tired after these steps :(
Don't worry you are just one step away from Laravel installation...
come lets do that one too :)
- Open command prompt at you desired location in your system
- Now you are installing LARAVEL through using composer
- enter a command
composer create-project laravel/laravel my-app
wait for a while to install all necessary dependencies
- then, Bingo
LARAVEL got installed, then you can see these messages
Then How to run this Application ?
That too still simple,
open command prompt inside a created laravel project
then enter
php artisan serve
You will get an URL, where our Laravel app is running
Ok... the last step :)
last one...
open the browser then hit the URL provided in a cmd propmt...
Hurray !!!!!
Our Laravel Application is running
Enough for now right!!!... Ok
I hope you gained some hint on What is Laravel? and How to install it?
Lets meet in the next topic on Laravel Application Structure and how MVC induced in it...
Bye :)
Top comments (2)
composer create-project laravel/laravel my-app
I am new to laravel, but just want to share about the above code.
note that my-app is the folder/laravel project to be created on the current directory appearing on the command prompt.
To create the project in another directory, just add e.g
composer create-project laravel/laravel e:/course/my-app
The project will now be created in folder course in drive e:
Nice explanation.