Skip to content

Vendor-neutral, engineer-written explanations. Clear definitions first, then practical steps with real examples — no fluff.

What is Laravel 12

SB
Written by StageBit Engineering Team
Updated January 2026 2 min readVerified by engineers
Laravel 12 Features and Updates

Laravel 12 is the latest major release of the Laravel PHP framework, built for modern, high-performance web applications. It introduces a restructured project layout, enhanced query and ORM features, asynchronous caching, AI-assisted debugging, and improved developer tools for faster and more secure development.

Laravel Versions and Support Timeline

Each Laravel release receives bug fixes for 18 months and security fixes for 2 years. This predictable cycle ensures applications remain stable and secure:

VersionPHP SupportRelease DateBug Fixes UntilSecurity Fixes Until
98.0 – 8.2Feb 8, 2022Aug 8, 2023Feb 6, 2024
108.1 – 8.3Feb 14, 2023Aug 6, 2024Feb 4, 2025
118.2 – 8.3Mar 12, 2024Sep 3, 2025Mar 12, 2026
128.2 – 8.3Q1 2025Q3 2026Q1 2027

1. New Application Structure: Cleaner and Organized

Laravel 12 simplifies the project structure for faster navigation:

  • app/Models is optional: Models can live directly in app/.
  • Config files centralized: All configuration now in config/*.
  • Routes grouped by type: Separate folders for API, web, and console routes.
  Before (Laravel 11):
  app/
  ├── Console/
  ├── Exceptions/
  ├── Http/
  │   ├── Controllers/
  │   └── Kernel.php
  routes/
  ├── web.php
  ├── api.php

  After (Laravel 12):
  app/
  ├── Http/
  │   └── Controllers/
  ├── Models/          # Optional
  └── Kernel.php
  routes/
  ├── web/
  │   └── web.php
  ├── api/
  │   └── v1.php       # Built-in API versioning
  

2. Advanced Query Builder: nestedWhere()

Nested conditions are simpler with nestedWhere():

  // Before Laravel 12
  Order::where(function ($q) {
      $q->where('status', 'pending')
        ->orWhere(function ($q) {
            $q->where('amount', '>', 100)
              ->where('priority', 'high');
        });
  })->get();

  // After Laravel 12
  Order::nestedWhere(function ($q) {
      $q->where('status', 'pending')
        ->orWhere('amount', '>', 100)
        ->where('priority', 'high');
  })->get();
  

3. Stronger Security: secureValidate()

Secure password policies are enforced automatically:

  // Before
  $request->validate([
      'password' => ['required', 'min:12', 'regex:/[A-Z]/', 'regex:/[0-9]/']
  ]);

  // After
  $request->secureValidate(['password' => 'required|secureValidate']);
  

4. Native GraphQL Support for APIs

Laravel 12 supports first-party GraphQL integration, making API development faster and cleaner. You can define schemas and query endpoints without third-party packages.

5. AI-Powered Debugging: debug()

Debugging is now smarter with real-time AI suggestions, including contextual fixes for common errors.

  debug($product->load('reviews'));
  // Outputs the product with reviews + SQL query log
  

6. Asynchronous Caching

Cache heavy operations without blocking user requests:

  // Before
  $topProducts = Cache::remember('top-products', 3600, function () {
      return Product::popular()->get();
  });

  // After
  $topProducts = Cache::async()->remember('top-products', 3600, function () {
      return Product::popular()->get(); // Runs in background
  });
  

7. Real-Time Features: WebSocket Support

Build live features like chat or dashboards without external services:

  php artisan websocket:serve

  class ChatMessage implements ShouldBroadcast {
      public function broadcastOn() {
          return new Channel('room');
      }
  }
  

8. Smarter Artisan CLI

Interactive commands reduce boilerplate and speed up development:

  php artisan make:controller
  ❓ Controller type? > API
  ❓ Generate CRUD? > Yes
  ✅ Controller created at app/Http/Controllers/Api/UserController.php
  

9. Enhanced Eloquent ORM

Conditional eager loading, filtered relationships, and constraints simplify database interactions:

  User::withFiltered('orders', ['status' => 'completed'])->get();
  

10. Job & Queue Management

Dynamic prioritization and delayed retries improve background task orchestration:

  dispatch(new SendInvoice($invoice))->prioritize('high');
  

11. Modern DevOps Integration

Automated deployment commands like deploy:prepare streamline cache clearing, migrations, and asset compilation.

Deprecated Functions in Laravel 12

  • Removal of restore() in global scopes.
  • Route helper supports only string-based routes.
  • Array-based relationship definitions in models are deprecated.
  • Validation rule same replaced with compare.
  • Old helper functions like parse_url() replaced with Url facade.

Conclusion:

Laravel 12 delivers a faster, more secure, and developer-friendly framework. From improved performance and asynchronous caching to AI-assisted debugging and WebSocket support, it equips developers to build scalable modern applications efficiently.

Was this answer helpful?

Your feedback helps us improve our answers.

Still need help?

Talk to our Laravel experts

We've handled GDPR/CCPA compliance for dozens of EU & US Laravel.

Talk to Laravel Experts

Tell us more about your brand!

Rohit Kundale, Our VP of Sales and Marketing is ready to meet with your team.