[go: up one dir, main page]

The PHP Framework for Web Artisans

Laravel is a web application framework with expressive, elegant syntax. We’ve already laid the foundation — freeing you to create without sweating the small things.

Write code for the joy of it.

Laravel values beauty. We love clean code just as much as you do. Simple, elegant syntax puts amazing functionality at your fingertips. Every feature has been thoughtfully considered to provide a wonderful developer experience.

Start Learning

One Framework, Many Flavors

Build robust, full-stack applications in PHP using Laravel and Livewire. Love JavaScript? Build a monolithic React or Vue driven frontend by pairing Laravel with Inertia.

Or, let Laravel serve as a robust backend API for your Next.js application, mobile application, or other frontend. Either way, our starter kits will have you productive in minutes.

Empower Your Frontend

Everything you need to be amazing.

Out of the box, Laravel has elegant solutions for the common features needed by all modern web applications. It's time to start building amazing applications and stop wasting time searching for packages and reinventing the wheel.

Authentication

Authenticating users is as simple as adding an authentication middleware to your Laravel route definition:

Route::get('/profile', ProfileController::class)
->middleware('auth');

Once the user is authenticated, you can access the authenticated user via the Auth facade:

use Illuminate\Support\Facades\Auth;
 
// Get the currently authenticated user...
$user = Auth::user();

Of course, you may define your own authentication middleware, allowing you to customize the authentication process.

For more information on Laravel's authentication features, check out the authentication documentation.

Authorization

You'll often need to check whether an authenticated user is authorized to perform a specific action. Laravel's model policies make it a breeze:

php artisan make:policy UserPolicy

Once you've defined your authorization rules in the generated policy class, you can authorize the user's request in your controller methods:

public function update(Request $request, Invoice $invoice)
{
Gate::authorize('update', $invoice);
 
$invoice->update(/* ... */);
}

Learn more

Eloquent ORM

Scared of databases? Don't be. Laravel’s Eloquent ORM makes it painless to interact with your application's data, and models, migrations, and relationships can be quickly scaffolded:

php artisan make:model Invoice --migration

Once you've defined your model structure and relationships, you can interact with your database using Eloquent's powerful, expressive syntax:

// Create a related model...
$user->invoices()->create(['amount' => 100]);
 
// Update a model...
$invoice->update(['amount' => 200]);
 
// Retrieve models...
$invoices = Invoice::unpaid()->where('amount', '>=', 100)->get();
 
// Rich API for model interactions...
$invoices->each->pay();

Learn more

Database Migrations

Migrations are like version control for your database, allowing your team to define and share your application's database schema definition:

public function up(): void
{
Schema::create('flights', function (Blueprint $table) {
$table->uuid()->primary();
$table->foreignUuid('airline_id')->constrained();
$table->string('name');
$table->timestamps();
});
}

Learn more

Validation

Laravel has over 90 powerful, built-in validation rules and, using Laravel Precognition, can provide live validation on your frontend:

public function update(Request $request)
{
$validated = $request->validate([
'email' => 'required|email|unique:users',
'password' => Password::required()->min(8)->uncompromised(),
]);
 
$request->user()->update($validated);
}

Learn more

Notifications & Mail

Use Laravel to quickly send beautifully styled notifications to your users via email, Slack, SMS, in-app, and more:

php artisan make:notification InvoicePaid

Once you have generated a notification, you can easily send the message to one of your application's users:

$user->notify(new InvoicePaid($invoice));

Learn more

File Storage

Laravel provides a robust filesystem abstraction layer, providing a single, unified API for interacting with local filesystems and cloud based filesystems like Amazon S3:

$path = $request->file('avatar')->store('s3');

Regardless of where your files are stored, interact with them using Laravel's simple, elegant syntax:

$content = Storage::get('photo.jpg');
 
Storage::put('photo.jpg', $content);

Learn more

Job Queues

Laravel lets you to offload slow jobs to a background queue, keeping your web requests snappy:

$podcast = Podcast::create(/* ... */);
 
ProcessPodcast::dispatch($podcast)->onQueue('podcasts');

You can run as many queue workers as you need to handle your workload:

php artisan queue:work redis --queue=podcasts

For more visibility and control over your queues, Laravel Horizon provides a beautiful dashboard and code-driven configuration for your Laravel-powered Redis queues.

Learn more

Task Scheduling

Schedule recurring jobs and commands with an expressive syntax and say goodbye to complicated configuration files:

$schedule->job(NotifySubscribers::class)->hourly();

Laravel's scheduler can even handle multiple servers and offers built-in overlap prevention:

$schedule->job(NotifySubscribers::class)
->dailyAt('9:00')
->onOneServer()
->withoutOverlapping();

Learn more

Testing

Laravel is built for testing. From unit tests to browser tests, you’ll feel more confident in deploying your application:

$user = User::factory()->create();
 
$this->browse(fn (Browser $browser) => $browser
->visit('/login')
->type('email', $user->email)
->type('password', 'password')
->press('Login')
->assertPathIs('/home')
->assertSee("Welcome {$user->name}")
);

Learn more

Events & WebSockets

Laravel's events allow you to send and listen for events across your application, and listeners can easily be dispatched to a background queue:

OrderShipped::dispatch($order);
class SendShipmentNotification implements ShouldQueue
{
public function handle(OrderShipped $event): void
{
// ...
}
}

Your frontend application can even subscribe to your Laravel events using Laravel Echo and WebSockets, allowing you to build real-time, dynamic applications:

Echo.private(`orders.${orderId}`)
.listen('OrderShipped', (e) => {
console.log(e.order);
});

Learn more

We've just scratched the surface. Laravel has you covered for everything you will need to build a web application, including email verification, rate limiting, and custom console commands. Check out the Laravel documentation to keep learning.

Move fast...
with confidence.

Laravel is committed to delivering the best testing experience you can imagine. No more brittle tests that are a nightmare to maintain. Beautiful testing APIs, database seeding, and painless browser testing let you ship with confidence.

Learn More

Enterprise scale without the enterprise complexity.

Our vast library of meticulously maintained packages means you're ready for anything. Let Laravel Octane supercharge your application's performance, and experience infinite scale on Laravel Vapor, our serverless deployment platform powered by AWS Lambda.

Loved by thousands of developers around the world.

“I’ve been using Laravel for nearly a decade and never been tempted to switch to anything else.“

Adam Wathan
Adam Wathan

Creator of Tailwind CSS

“Laravel takes the pain out of building modern, scalable web apps.“

Aaron Francis
Aaron Francis

Creator of Torchlight and Sidecar

“Laravel grew out to be an amazing innovative and active community. Laravel is so much more than just a PHP framework.“

Bobby Bouwmann
Bobby Bouwmann

Elite Developer at Enrise

“As an old school PHP developer, I have tried many frameworks; none has given me the development speed and enjoyment of use that I found with Laravel. It is a breath of fresh air in the PHP ecosystem, with a brilliant community around it.“

Erika Heidi
Erika Heidi

Creator of Minicli

“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
Caleb Porzio

Creator of Livewire and Alpine.js

“I found Laravel by chance, but I knew right away that I found my thing. The framework, the ecosystem and the community - it’s the perfect package. I’ve worked on amazing projects and met incredible people; it’s safe to say that Laravel changed my life.“

Zuzana Kunckova
Zuzana Kunckova

Full-Stack Developer

“Laravel’s best-in-class testing tools give me the peace of mind to ship robust apps quickly.“

Michael Dyrynda
Michael Dyrynda

Laravel Artisan + Laracon AU Organizer

“Laravel has been like rocket fuel for my career and business.“

Chris Arter
Chris Arter

Developer at Bankrate

“I've been using Laravel for over 10 years and I can't imagine using PHP without it.“

Eric L. Barnes
Eric L. Barnes

Founder of Laravel News

“I've been enjoying Laravel's focus on pushing developer experience to the next level for many years. All pieces of the ecosystem are powerful, well designed, fun to work with, and have stellar documentation. The surrounding friendly and helpful community is a joy to be a part of.“

Freek Van der Herten
Freek Van der Herten

Owner of Spatie

“Laravel and its ecosystem of tools help me build client projects faster, more secure, and higher quality than any other tools out there.“

Jason Beggs
Jason Beggs

Owner of Design to Tailwind

“I didn't fully appreciate Laravel's one-stop-shop, all-encompassing solution, until I tried (many) different ecosystems. Laravel is in a class of its own!“

Joseph Silber
Joseph Silber

Creator of Bouncer

“Laravel has helped me launch products quicker than any other solution, allowing me to get to market faster and faster as the community has evolved.“

Steve McDougall
Steve McDougall

Creator of Laravel Transporter

“I've been using Laravel for every project over the past ten years in a time where a new framework launches every day. To this date, there's just nothing like it.“

Philo Hermans
Philo Hermans

Founder of Anystack

“Laravel is for developers who write code because they can rather than because they have to.“

Luke Downing
Luke Downing

Maker + Developer

“Laravel makes building web apps exciting! It has also helped me to become a better developer 🤙“

Tony Lea
Tony Lea

Founder of DevDojo

“The Laravel ecosystem has been integral to the success of our business. The framework allows us to move fast and ship regularly, and Laravel Vapor has allowed us to operate at an incredible scale with ease.“

Jack Ellis
Jack Ellis

Co-founder of Fathom Analytics

A community built for people like you.

Laravel is for everyone — whether you have been programming for 20 years or 20 minutes. It's for architecture astronauts and weekend hackers. For those with degrees and for those who dropped out to chase their dreams. Together, we create amazing things.

laracon

Watch us on Laracasts

Tune In

Laracasts includes free videos and tutorials covering the entire Laravel ecosystem. Stay up to date by watching our latest videos.

Start Watching
partners

Hire a partner for your next project

Laravel Partners are elite shops providing top-notch Laravel development and consulting. Each of our partners can help you craft a beautiful, well-architected project.

Browse Partners