Page Inspect
Internal Links
41
External Links
27
Images
43
Headings
62
Page Content
Title:Laravel - The PHP Framework For Web Artisans
Description:Laravel is a PHP web application framework with expressive, elegant syntax. We’ve already laid the foundation — freeing you to create without sweating the small things.
HTML Size:1353 KB
Markdown Size:23 KB
Fetched At:November 17, 2025
Page Structure
h3PHP Framework
h3AI Tools
h3Starter Kits
h3Packages
h3Developers
h3Resources
h3Featured events
h3Learn
h3All Products
h3PHP Framework
h3AI Tools
h3Starter Kits
h3Packages
h3Developers
h3Resources
h3Upcoming Events
h3Learn
h2Build and ship
software with
tools crafted for
productivity
h3Ecosystem
h3A PHP framework with a robust ecosystem
h4React Starter Kit
Free
h4Vue Starter Kit
Free
h4Livewire Starter Kit
Free
h4Cloud
New
h4Nightwatch
New
h4Forge
h4Nova
h3Backend
h3Code that speaks for itself
h3Authentication
h3Authorization
h3Eloquent
h3Migrations
h3Validation
h3Notification and mail
h3File Storage
h3Job Queues
h3Task Scheduling
h3Testing
h3Events and WebSockets
h3Frontend
h3Frontend for any stack
h3Inertia
h3Livewire
h3SPA and Mobile Apps
h3Deploy
h3Managed or self-hosted deployment platforms
h3Cloud
h3Forge
h3Monitor
Markdown Content
Laravel - The PHP Framework For Web Artisans
Fully managed Reverb is here, only on Laravel Cloud →
- Home
- Products
- Framework
- Resources
- Docs
- Partners
- GitHub 82K
- Search docs
⌘K
- Deploy
- Docs
Cloud New
A fully managed application platform for deploying and hosting Laravel applications.
Pay as you go pricing
Nightwatch New
Unparalleled monitoring and insights into your application's performance.
Get started for free
Forge
Next-generation server management with instant provisioning and zero-downtime deployments.
Plans from $12 / month
Nova
The simplest and fastest way to build production-ready administration panels using Laravel.
Licenses from $99
### PHP Framework
- Laravel Framework Open source PHP web framework
### AI Tools
- Boost New AI-powered development assistant
- Laravel MCP New Build AI interactions with Laravel
### Starter Kits
- React New Laravel, Inertia, React, and Tailwind
- Vue New Laravel, Inertia, Vue, and Tailwind
- Livewire New Laravel, Livewire, and Tailwind
### Packages
- Scout Search for Eloquent models
- Octane High performance app server
- Reverb Fast, scalable WebSockets
- Echo Listen for WebSocket events
- Pennant Feature flag management
- Cashier Payments and subscriptions
- Socialite Social authentication
- Sanctum API authentication
- Sail Local Docker development
- Pint Code styler for minimalists
- Horizon Monitor Redis queues
- Dusk Automated browser testing
- Telescope Local debugging and insights
- Pulse Performance insights
### Developers
- Documentation
- Release notes
### Resources
- Screencasts
- Forums
- News
- Jobs
### Featured events
All events
### Learn
See the courses
Laravel Bootcamp with Josh Cirre PHP fundamentals with Christoph Rumpel 30 days to learn Laravel with Jeffrey Way
- Products
- Framework
- Resources
- Docs
- Partners
### All Products
- Cloud New Managed infrastructure
- Nightwatch New Monitoring, logs, and insights
- Forge VPS server management
- Nova Production admin panels
### PHP Framework
- Laravel Framework Open source PHP web framework
### AI Tools
- Boost AI-powered development assistant
- Laravel MCP Build AI interactions with Laravel
### Starter Kits
- React New Laravel, Inertia, React, and Tailwind
- Vue New Laravel, Inertia, Vue, and Tailwind
- Livewire New Laravel, Livewire, and Tailwind
### Packages
- Scout Search for Eloquent models
- Octane High performance app server
- Reverb Fast, scalable WebSockets
- Echo Listen for WebSocket events
- Pennant Feature flag management
- Cashier Payments and subscriptions
- Socialite Social authentication
- Sanctum API authentication
- Sail Local Docker development
- Pint Code styler for minimalists
- Horizon Monitor Redis queues
- Dusk Automated browser testing
- Telescope Local debugging and insights
- Pulse Performance insights
### Developers
- Documentation
- Release notes
### Resources
- Screencasts
- Forums
- News
- Jobs
### Upcoming Events
### Learn
See the courses
Laravel Bootcamp with Josh Cirre PHP fundamentals with Christoph Rumpel 30 days to learn Laravel with Jeffrey Way
## Build and ship
software with tools crafted for
productivity
Laravel provides a complete ecosystem for web artisans. Our open source PHP framework, products, packages, and starter kits offer everything you need to build, deploy, and monitor web applications.
Get started Start deploying
- composer global require laravel/installer
- laravel new example-app
- You're all set. Read documentation
Play Video
Watch video 2 mins
Trusted by thousands of companies around the world
### Ecosystem
### A PHP framework with a robust ecosystem
Out of the box, Laravel has elegant solutions for the common features needed by all modern web applications. Our first-party packages offer opinionated solutions for specific problems so you don't need to reinvent the wheel.
- Scout Free Search for Eloquent models
- Octane Free High performance app server
- Reverb Free Fast, scalable WebSockets
- Echo Free Listen for WebSocket events
- Pennant Free Feature flag management
- Cashier Free Payments and subscriptions
- Socialite Free Social authentication
- Sanctum Free API authentication
- Sail Free Local Docker development
- Pint Free Code styler for minimalists
- Horizon Free Monitor Redis queues
- Dusk Free Automated browser testing
- Telescope Free Local debugging and insights
- Pulse Free Performance insights
- #### React Starter Kit Free
Everything you need to create an application with Laravel, Inertia, and React.
Get started
Live preview
- #### Vue Starter Kit Free
Everything you need to create an application with Laravel, Inertia, and Vue.
Get started
Live preview
- #### Livewire Starter Kit Free
Everything you need to create an application with Laravel and Livewire.
Get started
Live preview
- All starter kits include the routes, controllers, and views you need to authenticate users.
Registration, log in, password reset, email verification, profile settings, dashboard, light and dark mode, and optional WorkOS AuthKit support is included.
Learn more about Starter Kits
- #### Cloud New
Fully managed infrastructure platform for deploying and hosting PHP applications.
Pay as you go pricing
Deploy now
- #### Nightwatch New
Unparalleled monitoring and insights into your Laravel application's performance.
Get started for free
Get started
- #### Forge
Next-gen server management for PHP and any modern web stack
Plans from $12 / month
Get started
- #### Nova
The simplest and fastest way to build production-ready admin panels using Laravel.
Licenses from $99
Buy license
### Backend
### Code that speaks for itself
Simple, elegant syntax powers amazing functionality. Every feature has been considered to create a thoughtful and cohesive development experience.
### Authentication
**1**Add an authentication middleware to your Laravel route
` 1Route::get('/profile', ProfileController::class) 2 ->middleware('auth'); Route::get('/profile', ProfileController::class) ->middleware('auth'); `
**2**You can access the authenticated user via the Auth facade
` 1use Illuminate\Support\Facades\Auth; 2 3$user = Auth::user(); use Illuminate\Support\Facades\Auth; $user = Auth::user(); `
Read Authentication docs
### Authorization
**1**Define a policy for your model
` 1public function update(User $user, Post $post): Response 2{ 3 return $user->id === $post->user_id 4 ? Response::allow() 5 : Response::deny('You do not own this post.'); 6} public function update(User $user, Post $post): Response { return $user->id === $post->user_id ? Response::allow() : Response::deny('You do not own this post.'); } `
**2**Use the policy via the Gate facade
` 1Gate::authorize('update', $post); Gate::authorize('update', $post); `
Read Authorization docs
### Eloquent
**1**Define a model for your database table
` 1<?php 2 3namespace App\Models; 4 5use Illuminate\Database\Eloquent\Model; 6 7class Flight extends Model 8{ 9 // ... 10} <?php namespace App\Models; use Illuminate\Database\Eloquent\Model; class Flight extends Model { // ... } `
**2**Use Eloquent to retrieve records from the database
` 1use App\Models\Flight; 2 3foreach (Flight::all() as $flight) { 4 echo $flight->name; 5} use App\Models\Flight; foreach (Flight::all() as $flight) { echo $flight->name; } `
Read Eloquent docs
### Migrations
**1**Create a migration for your database table
` 1php artisan make:migration create_posts_table --create=posts php artisan make:migration create_posts_table --create=posts `
**2**Define the schema in your migration file
` 1class CreatePostsTable extends Migration 2{ 3 public function up() 4 { 5 Schema::create('posts', function (Blueprint $table) { 6 $table->id(); 7 $table->string('title'); 8 $table->text('content'); 9 $table->foreignId('user_id')->constrained()->onDelete('cascade'); 10 $table->timestamps(); 11 }); 12 } 13} class CreatePostsTable extends Migration { public function up() { Schema::create('posts', function (Blueprint $table) { $table->id(); $table->string('title'); $table->text('content'); $table->foreignId('user_id')->constrained()->onDelete('cascade'); $table->timestamps(); }); } } `
Read Migration docs
### Validation
**1**Define validation rules in your controller
` 1public function store(Request $request) 2{ 3 $validated = $request->validate([ 4 'title' => 'required|max:255', 5 'content' => 'required', 6 'email' => 'required|email', 7 ]); 8} public function store(Request $request) { $validated = $request->validate([ 'title' => 'required|max:255', 'content' => 'required', 'email' => 'required|email', ]); } `
**2**Handle validation errors in your view
` 1@if ($errors->any()) 2 <div class="alert alert-danger"> 3 <ul> 4 @foreach ($errors->all() as $error) 5 <li>{{ $error }}</li> 6 @endforeach 7 </ul> 8 </div> 9@endif @if ($errors->any()) <div class="alert alert-danger"> <ul> @foreach ($errors->all() as $error) <li>{{ $error }}</li> @endforeach </ul> </div> @endif `
Read Validation docs
### Notification and mail
**1**Define the notification content
` 1class PostCreated extends Notification 2{ 3 public function via() 4 { 5 return ['mail', 'database']; // Send via mail and store in database 6 } 7 8 public function toMail($notifiable) 9 { 10 return (new MailMessage) 11 ->subject('New Post Created') 12 ->line('A new post has been created: ' . $this->post->title) 13 ->action('View Post', url('/posts/' . $this->post->id)) 14 ->line('Thank you for using our application!'); 15 } 16} class PostCreated extends Notification { public function via() { return ['mail', 'database']; // Send via mail and store in database } public function toMail($notifiable) { return (new MailMessage) ->subject('New Post Created') ->line('A new post has been created: ' . $this->post->title) ->action('View Post', url('/posts/' . $this->post->id)) ->line('Thank you for using our application!'); } } `
**2**Send the notification to the user
` 1public function store(Request $request) 2{ 3 $post = Post::create($request->all()); 4 5 $request->user()->notify(new PostCreated($post)); 6} public function store(Request $request) { $post = Post::create($request->all()); $request->user()->notify(new PostCreated($post)); } `
Read Notification and Mail docs
### File Storage
**1**Configure your filesystem
` 1FILESYSTEM_DRIVER=s3 FILESYSTEM_DRIVER=s3 `
**2**Handle file uploads in your controller
` 1public function store(Request $request) 2{ 3 if ($request->hasFile('image')) { 4 $path = $request->file('image')->store('images', 'public'); 5 } 6} public function store(Request $request) { if ($request->hasFile('image')) { $path = $request->file('image')->store('images', 'public'); } } `
Read File Storage docs
### Job Queues
**1**Define the job logic
` 1class ProcessPost implements ShouldQueue 2{ 3 public function handle() 4 { 5 $this->post->update([ 6 'rendered_content' => Str::markdown($this->post->content) 7 ]); 8 } 9} class ProcessPost implements ShouldQueue { public function handle() { $this->post->update([ 'rendered_content' => Str::markdown($this->post->content) ]); } } `
**2**Dispatch the job from your controller
` 1public function store(Request $request) 2{ 3 $post = Post::create($request->all()); 4 5 ProcessPost::dispatch($post); 6} public function store(Request $request) { $post = Post::create($request->all()); ProcessPost::dispatch($post); } `
Read Queue docs
### Task Scheduling
**1**Define the command logic
` 1class SendEmails extends Command 2{ 3 protected $signature = 'emails:send'; 4 5 protected $description = 'Send scheduled emails'; 6 7 public function handle() 8 { 9 // Send your emails... 10 } 11} class SendEmails extends Command { protected $signature = 'emails:send'; protected $description = 'Send scheduled emails'; public function handle() { // Send your emails... } } `
**2**Schedule the task
` 1Schedule::command('emails:send')->daily(); Schedule::command('emails:send')->daily(); `
Read Task Scheduling docs
### Testing
**1**Write your test using Pest
` 1it('can create a post', function () { 2 $response = $this->post('/posts', [ 3 'title' => 'Test Post', 4 'content' => 'This is a test post content.', 5 ]); 6 7 $response->assertStatus(302); 8 9 $this->assertDatabaseHas('posts', [ 10 'title' => 'Test Post', 11 ]); 12}); it('can create a post', function () { $response = $this->post('/posts', [ 'title' => 'Test Post', 'content' => 'This is a test post content.', ]); $response->assertStatus(302); $this->assertDatabaseHas('posts', [ 'title' => 'Test Post', ]); }); `
**2**Run the tests on the command line
` 1php artisan test php artisan test `
Read Testing docs
### Events and WebSockets
**1**Create your event
` 1class PostCreated implements ShouldBroadcast 2{ 3 use Dispatchable, SerializesModels; 4 5 public $post; 6 7 public function __construct(Post $post) 8 { 9 $this->post = $post; 10 } 11} class PostCreated implements ShouldBroadcast { use Dispatchable, SerializesModels; public $post; public function __construct(Post $post) { $this->post = $post; } } `
**2**Dispatch the event in your controller
` 1public function store(Request $request) 2{ 3 $post = Post::create($request->all()); 4 5 PostCreated::dispatch($post); 6} public function store(Request $request) { $post = Post::create($request->all()); PostCreated::dispatch($post); } `
**3**In your JavaScript file, listen for the event
` 1Echo.channel("posts." + postId).listen("PostCreated", (e) => { 2 console.log("Post created:", e.post); 3}); Echo.channel("posts." + postId).listen("PostCreated", (e) => { console.log("Post created:", e.post); }); `
Read Events docs
### Frontend
### Frontend for any stack
Whether you prefer a traditional PHP backend, a modern frontend using Laravel Livewire, or can't get enough React and Vue, Laravel allows you to deliver highly polished and maintainable applications in a fraction of the time.
` 1class UserController 2{ 3 public function index() 4 { 5 $users = User::active() 6 ->orderByName() 7 ->get(['id', 'name', 'email']); 8 9 return Inertia::render('Users', [ 10 'users' => $users, 11 ]); 12 } 13} class UserController { public function index() { $users = User::active() ->orderByName() ->get(['id', 'name', 'email']); return Inertia::render('Users', [ 'users' => $users, ]); } } `
` 1export default ({ users }) => { 2 return ( 3 <div> 4 <h1>Users</h1> 5 <ul> 6 {users.map((user) => ( 7 <li key={user.id}>{user.name}</li> 8 ))} 9 </ul> 10 </div> 11 ); 12}; export default ({ users }) => { return ( <div> <h1>Users</h1> <ul> {users.map((user) => ( <li key={user.id}>{user.name}</li> ))} </ul> </div> ); }; `
### Inertia
Modern Monoliths
Laravel Inertia supercharges your Laravel experience and works seamlessly with React, Vue, and Svelte. Inertia handles routing and transferring data between your backend and frontend, with no need to build an API or maintain two sets of routes.
Read Inertia docs
` 1class Counter extends Component 2{ 3 public $count = 1; 4 5 public function increment() 6 { 7 $this->count++; 8 } 9 10 public function decrement() 11 { 12 $this->count--; 13 } 14 15 public function render() 16 { 17 return view('livewire.counter'); 18 } 19} class Counter extends Component { public $count = 1; public function increment() { $this->count++; } public function decrement() { $this->count--; } public function render() { return view('livewire.counter'); } } `
` 1<div> 2 <h1>{{ $count }}</h1> 3 4 <button wire:click="increment">+</button> 5 6 <button wire:click="decrement">-</button> 7</div> <div> <h1>{{ $count }}</h1> <button wire:click="increment">+</button> <button wire:click="decrement">-</button> </div> `
### Livewire
Super Powered Blade
Laravel Livewire transforms your Laravel applications by bringing dynamic, reactive interfaces directly to your Blade templates. Livewire seamlessly bridges the gap between server-side rendering and client-side interactivity, allowing you to create modern, interactive components without leaving the comfort of Laravel.
Read Livewire docs
` 1Route::get('/api/user', function (Request $request) { 2 return $request->user(); 3})->middleware('auth:sanctum'); Route::get('/api/user', function (Request $request) { return $request->user(); })->middleware('auth:sanctum'); `
### SPA and Mobile Apps
Built-in Auth
Laravel empowers developers to build robust backends for single-page applications (SPAs) and mobile apps with ease and efficiency. With built-in support for RESTful APIs, authentication, and database management, Laravel simplifies the process of connecting your backend to modern frontend frameworks like Vue.js or React.
Read Sanctum docs
### Deploy
### Managed or self-hosted deployment platforms
Laravel Cloud provides a fully managed application platform for Laravel applications, while Forge allows you to self-manage VPS servers running Laravel applications.
### Cloud
Product
A fully managed application platform built for developers and teams who just want to ship their next big idea.
Deploy now
Pay as you go pricing
### Forge
Product
Provision VPS servers and deploy unlimited PHP applications on DigitalOcean, Akamai, Vultr, Amazon, Hetzner, and more.
Deploy now
Plans from $12.00 / month
### Monitor
### Application monitoring,
logging, and testing
Every Laravel application can achieve enterprise-grade quality with monitoring, observability, and testing tools that empower you to ship with confidence.
### Nightwatch
Product
Monitoring built for Laravel developers and teams that need to know exactly what's happening in their application.
Monitor now
Get started for free
### Pulse
Package
At-a-glance insights into your application's performance and usage. Track down bottlenecks like slow jobs and endpoints, find your most active users, and more.
Install
Free
### Telescope
Package
An elegant debug assistant providing insight into the requests coming into your application, exceptions, log entries, database queries, queued jobs, and more.
Install
Free
### Pest
Package
Pest is a testing framework with a focus on simplicity, meticulously designed to bring back the joy of testing in PHP.
Install
Free
### Community
### Trusted by developers, startups, and enterprises
Join thousands of developers and companies around the world.
> “I've been using Laravel for nearly a decade and have never been tempted to switch to anything else.”
Adam Wathan Founder, Tailwind
> “Laravel is our sourdough starter and multitool for web projects large and small. 10 years in, it remains fresh and useful.”
Ian Callahan Harvard Art Museums
> “Laravel takes the pain out of building modern, scalable web apps.”
Aaron Francis Co-founder, Try Hard Studios
> “Laravel's elegance, performance, and developer experience are unmatched.”
Chandresh Patel CEO, Bacancy
> “Shipping apps with Laravel means balancing performance, flexibility, and simplicity—while ensuring a great developer experience.”
Peter Steenbergen Elastic
> “Laravel is a breath of fresh air in the PHP ecosystem, with a brilliant community around it.”
Erika Heidi Creator, Minicli
> “The framework, the ecosystem and the community - it's the perfect package.”
Zuzana Kunckova Founder, Larabelles
> “AI development moves fast. With Laravel, shipping AI-powered applications has never been easier.”
Jordan Price Bestie AI
> “With Laravel we can build our clients scalable, performant web apps and APIs in months that would otherwise take years.”
Matt Stauffer Tighten
> “Laravel's best-in-class testing tools give me the peace of mind to ship robust apps quickly.”
Michael Dyrynda Laravel Artisan + Laracon AU Organizer
> “Laravel has made it very simple to create services that handle hundreds of millions of requests and billions of background per day.”
Sebastien Armand Developer, Square
> “Laravel has helped me launch products quicker than any other solution, allowing me to get to market faster as the community has evolved.”
Steve McDougall Creator of Laravel Transporter
> “Laravel has been like rocket fuel for my career and business.”
Chris Arter Developer at Bankrate
> “I've been using Laravel for every project over the past ten years, to this date, there's just nothing like it.”
Philo Hermans Founder of Anystack
> “I've been using Laravel for over 10 years and I can't imagine using PHP without it.”
Eric L. Barnes Founder of Laravel News
> “Laravel is for developers who write code because they can rather than because they have to.”
Luke Downing Maker + Developer
> “I've been enjoying Laravel's focus on pushing DX to the next level for many years. It is well-designed and has stellar documentation.”
Freek Van der Herten Owner of Spatie
> “The Laravel ecosystem has been integral to the success of our business. The framework allows us to move fast and ship regularly.”
Jack Ellis Founder, Fathom Analytics
> “Laravel is nothing short of a delight. It allows me to build any web-y thing I want in record speed with joy.”
Caleb Porzio Creator of Livewire and Alpine.js
> “I didn't fully appreciate Laravel's one-stop-shop solution until I tried (many) different ecosystems. Laravel is in a class of its own!”
Joseph Silber Creator of Bouncer
Show more
### Ready to create your next big idea?
Get started now and ship something amazing.
Read docs Deploy now
Laravel is the most productive way to
build, deploy, and monitor software.
-
-
-
-
- © 2025 Laravel
- Legal
- Status
#### Products
- Cloud
- Forge
- Nightwatch
- Vapor
- Nova
#### Packages
- Cashier
- Dusk
- Horizon
- Octane
- Scout
- Pennant
- Pint
- Sail
- Sanctum
- Socialite
- Telescope
- Pulse
- Reverb
- Echo
#### Resources
- Documentation
- Starter Kits
- Release Notes
- Blog
- News
- Community
- Larabelles
- Learn
- Jobs
- Careers
- Trust
#### Partners
- More Partners