Laravel remains the most widely used PHP framework for building web applications, APIs, and increasingly AI-powered products, thanks to its Laravel AI SDK. If you’re evaluating Laravel framework development for a project or just want to understand how it works before you brief a development team, this guide walks through the full MVC request cycle from installing Laravel to rendering your first page using the current Laravel 13 release.
Laravel is a PHP web framework built on the MVC (Model-View-Controller) pattern. To get started: install PHP 8.3+ and Composer, run laravel new your-app, then build out a Model, Migration, Controller, Route, and Blade View for each resource in your application.
What You Need Before You Start
- PHP 8.3 or higher (Laravel 13’s minimum requirement)
- Composer (PHP’s dependency manager)
- A database โ MySQL, PostgreSQL, or SQLite (SQLite ships as the zero-config default for new projects)
- The Laravel installer:
composer global require laravel/installer
How Laravel’s MVC Pattern Works
Laravel is built on MVC architecture, which separates an application into three responsibilities:
- Models: talk to the database and represent your data as PHP objects (Eloquent ORM).
- Views: the Blade templates that render HTML back to the user.
- Controllers: sit in between; they receive requests, ask a model for data, and hand that data to a view.
- Routes: map an incoming URL to the controller action that should handle it.
The Request Lifecycle
- Request: a user hits a URL in your app.
- Route:
routes/web.phpmatches that URL to a controller action. - Controller: the action asks the relevant Model for data, then passes it to a View.
- View: Blade renders the final HTML response.
Step 1: Install Laravel
bash
composer global require laravel/installer
laravel new blog-app
cd blog-app
php artisan serve
The installer will prompt you to choose a starter kit (React, Vue, Livewire, or API-only), a testing framework (Pest is the default suggestion in 13.x), and a database. Since Laravel 11, the application skeleton is intentionally minimal. There’s no separate Kernel.php anymore; middleware, routing, and exception handling are all configured in bootstrap/app.php.
Step 2: Create a Model and Migration
Use Artisan, Laravel’s built-in CLI, to scaffold a model with a migration in one command:
bash
php artisan make:model Post --migration
This generates app/Models/Post.php and a migration file under database/migrations/. In Laravel 13 you can define table configuration either the traditional way or with the newer attribute syntax:
php
// Traditional property syntax (still fully supported)
class Post extends Model
{
protected $table = 'posts';
protected $fillable = ['title', 'body', 'published_at'];
}
php
// New in Laravel 13: attribute syntax
#[Table('posts')]
class Post extends Model
{
protected $fillable = ['title', 'body', 'published_at'];
}
Then define your table columns in the migration and run it:
php
Schema::create('posts', function (Blueprint $table) {
$table->id();
$table->string('title');
$table->text('body');
$table->timestamp('published_at')->nullable();
$table->timestamps();
});
bash
php artisan migrate
Step 3: Create a Resource Controller
Laravel treats a data type like Post as a resource, with a controller that handles the standard CRUD actions (index, create, store, show, edit, update, destroy):
bash
php artisan make:controller PostController --resource --model=Post
Using --model=Post also type-hints the model into each method automatically via route model binding, so you skip manual Post::find($id) lookups in most cases.
Step 4: Register Routes
In routes/web.php:
php
use App\Http\Controllers\PostController;
Route::resource('posts', PostController::class);
That single line generates all seven RESTful routes:
| Method | URI | Action | Route Name |
|---|---|---|---|
| GET | /posts | index | posts.index |
| GET | /posts/create | create | posts.create |
| POST | /posts | store | posts.store |
| GET | /posts/{post} | show | posts.show |
| GET | /posts/{post}/edit | edit | posts.edit |
| PUT/PATCH | /posts/{post} | update | posts.update |
| DELETE | /posts/{post} | destroy | posts.destroy |
Step 5: Build the Show Action
With route model binding, the controller method receives the already-resolved model, so no manual lookup is required:
php
public function show(Post $post)
{
return view('posts.show', compact('post'));
}
Step 6: Build the Blade View
Create resources/views/posts/show.blade.php:
blade
<!DOCTYPE html>
<html>
<head>
<title>{{ $post->title }}</title>
</head>
<body>
<h1>{{ $post->title }}</h1>
<p>{{ $post->body }}</p>
<small>Published: {{ $post->published_at?->format('M d, Y') }}</small>
</body>
</html>
Blade’s {{ }} syntax auto-escapes output for you, compiling down to <?php echo e($post->title); ?> behind the scenes, which protects you from XSS by default.
Step 7: Test It
Laravel 13 defaults new projects to Pest for testing. A quick feature test for the route above:
php
it('shows a single post', function () {
$post = Post::factory()->create();
$this->get(route('posts.show', $post))
->assertOk()
->assertSee($post->title);
});
bash
php artisan test
Frequently Asked Questions
Is Laravel still relevant in 2026? Yes. Laravel 13 is under active development with a stable release cadence, a production-ready AI SDK, and one of the largest PHP job markets and package ecosystems (Packagist/Composer) of any framework.
What PHP version does Laravel need in 2026? Laravel 13 requires PHP 8.3 or later. Laravel 12 (PHP 8.2 minimum) continues to receive security fixes until February 2027 if you’re maintaining an existing app.
Do I need to know PHP before learning Laravel? Yes. Laravel is a PHP framework, so a working knowledge of PHP fundamentals (OOP, namespaces, Composer) will make this guide much easier to follow.
What’s the difference between Laravel and plain PHP? Laravel provides routing, an ORM (Eloquent), templating (Blade), authentication, queues, and testing tooling out of the box, replacing hundreds of hours of boilerplate you’d otherwise write by hand in plain PHP.
Should I hire a Laravel developer or build it myself? For a learning project or small internal tool, this guide is enough to get moving. For production applications with security, scaling, or timeline requirements, working with an experienced Laravel development team is usually faster and safer.
Final Thoughts
The MVC flow hasn’t fundamentally changed since Laravel’s early versions. Model, Migration, Controller, Route, View is still the backbone of every Laravel app. What has changed is the tooling around it: PHP 8.3, a leaner skeleton, attribute-based configuration, and first-party AI and testing tooling. If you’d rather have this built for you than build it yourself, talk to our Laravel development team about your project.





















































