Laravel is a free, open-source PHP framework for building web applications. A framework gives you a ready structure and tools, so you do not write routing, database code, login and security from scratch every time.
Why use Laravel?
- Clean routing — map URLs to code in one line
- Eloquent ORM — work with database tables as PHP objects
- Blade templates — simple, fast HTML views
- Built-in security — CSRF protection, password hashing, escaping output
- Artisan — a command-line tool that generates code for you
- Huge ecosystem — Breeze, Sanctum, queues, mail, testing
The MVC pattern
Laravel follows Model–View–Controller:
- Model — talks to the database (e.g.
Post) - View — the HTML the user sees (Blade files)
- Controller — receives the request, uses models and returns a view
What you need to know first
Basic PHP (variables, arrays, functions, classes), HTML and a little SQL. If you are new to PHP, finish the PHP tutorial first.
Example
Example — A complete Laravel page in one route
PHP
<?php
// routes/web.php
use Illuminate\Support\Facades\Route;
Route::get('/hello', function () {
return 'Hello from Laravel!';
});
Open http://127.0.0.1:8000/hello and the browser shows: Hello from Laravel! One line maps a URL to the code that answers it.