Laravel Basics · Lesson 1 of 5
What a framework gives you
See what Laravel removes from your day.
PHP written without a framework works. What it does not do is stay organised once there are more than about twenty files and more than one person.
Laravel gives you four things that matter immediately.
A place for everything. Routes here, controllers there, models over here, views in one folder. That sounds like bureaucracy until you open somebody else's Laravel project and find your way around in five minutes, which is the actual benefit.
Security by default. Escaped output in templates, so a comment containing a script tag is displayed rather than executed. Prepared statements, so a form field cannot become SQL. A CSRF token on every form. Every one of these is a hole that hand written PHP has to remember to close every single time.
Batteries included. Authentication, validation, database migrations, queues, scheduled tasks, mail, file storage. These exist in every project, and writing them yourself means writing them slightly wrong.
Migrations and seeds, which mean your database schema lives in version control alongside the code instead of in somebody's memory and a backup file.
The cost is that you learn the framework's conventions, and there are many. The payoff is that those conventions are shared: a Laravel developer in Karachi can join your project and be useful the same week.
Install with Composer. Use the current version. Learn PHP properly alongside, because a developer who only knows the framework is lost the moment something behaves unexpectedly.
Create a new Laravel project and read the folder structure. Write one line for each top level folder saying what belongs in it.
نیا Laravel پروجیکٹ بنائیں اور فولڈر کی ساخت پڑھیں۔ ہر بڑے فولڈر کے لیے ایک سطر لکھیں کہ اس میں کیا رکھا جاتا ہے۔
Check what you learned
Create your free BvLogic ID to take the quiz and record your score.
Create your BvLogic ID