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.
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 LearningBuild 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 FrontendOut 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.
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.
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(/* ... */);}
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();
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(); });}
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);}
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));
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);
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
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();
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}"));
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); });
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.
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 MoreOur 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.
“I’ve been using Laravel for nearly a decade and never been tempted to switch to anything else.“
Adam WathanCreator of Tailwind CSS
“Laravel takes the pain out of building modern, scalable web apps.“
Aaron FrancisCreator 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 BouwmannElite 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 HeidiCreator 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.“
“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 KunckovaFull-Stack Developer
“Laravel’s best-in-class testing tools give me the peace of mind to ship robust apps quickly.“
Michael DyryndaLaravel Artisan + Laracon AU Organizer
“Laravel has been like rocket fuel for my career and business.“
Chris ArterDeveloper at Bankrate
“I've been using Laravel for over 10 years and I can't imagine using PHP without it.“
Eric L. BarnesFounder 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 HertenOwner 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 BeggsOwner 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 SilberCreator 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 McDougallCreator 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 HermansFounder of Anystack
“Laravel is for developers who write code because they can rather than because they have to.“
Luke DowningMaker + Developer
“Laravel makes building web apps exciting! It has also helped me to become a better developer 🤙“
Tony LeaFounder 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 EllisCo-founder of Fathom Analytics
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.
Laracasts includes free videos and tutorials covering the entire Laravel ecosystem. Stay up to date by watching our latest videos.
Start WatchingLaravel 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