Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Framework Laravel Package

laravel/framework

Laravel Framework core provides an elegant PHP foundation for building web apps: fast routing, powerful service container, sessions/caching, database migrations, queues, and real-time broadcasting—tools that scale from small projects to large applications.

View on GitHub
Deep Wiki
Context7
## Getting Started

### Minimal Steps
1. **Installation**:
   ```bash
   composer require laravel/framework:^12.60.2
  • Update Laravel core to leverage the latest improvements, including managed queue bootstrapping.
  1. First Use Case:

    • Managed Queues: Ensure queues are bootstrapped before service providers by default:
      php artisan queue:work --queue=high --daemon
      
    • Service Provider Order: Verify queue workers start before providers requiring queue connections:
      // In AppServiceProvider or similar
      public function boot()
      {
          // Queue-related logic now runs earlier in the lifecycle
      }
      
    • Queue Configuration: Confirm QUEUE_CONNECTION is set in .env:
      QUEUE_CONNECTION=database  # or 'cloud', 'redis', etc.
      
  2. Where to Look First:

    • Release Notes: Laravel v12.60.2 for bootstrapping changes.
    • Queue Configuration: Check config/queue.php for connection settings.
    • Service Provider Order: Review config/app.php under providers to ensure queue-dependent providers are ordered correctly.

Implementation Patterns

Core Workflows

  1. Managed Queues:

    • Daemon Mode: Use --daemon for long-running workers with proper bootstrapping:
      php artisan queue:work --daemon --queue=critical
      
    • Boot Order: Leverage the new bootstrapping to initialize queue connections early:
      // Queue jobs dispatched in providers will now work as expected
      Queue::push(new ProcessPodcastJob($podcast));
      
    • Cloud Queues: Configure in .env with the new boot order in mind:
      QUEUE_CONNECTION=cloud
      CLOUD_QUEUE_URL=sqs://your-queue-url
      
  2. Service Provider Integration:

    • Queue-Dependent Logic: Move queue-related logic to boot() methods in providers, as queues are now guaranteed to be available:
      public function boot()
      {
          if (config('app.queue_enabled')) {
              Queue::later(now()->addMinutes(5), new SendReminderJob($user));
          }
      }
      
  3. Testing:

    • Queue Boot Order: Test queue-dependent providers with:
      public function test_queue_boot_order()
      {
          $this->artisan('queue:work --once')
               ->expectsOutput('Job processed successfully');
      }
      
    • Service Provider Boot: Verify provider boot order with:
      $this->app->make('queue')->shouldBeAvailable();
      

Integration Tips

  • Queue Workers: Use --once for testing boot order:
    php artisan queue:work --once --queue=default
    
  • Provider Ordering: Ensure queue-dependent providers are not marked as deferred in config/app.php.
  • Cloud Queues: Validate boot order with cloud connections by checking logs:
    php artisan queue:work --verbose
    

Gotchas and Tips

Pitfalls

  1. Service Provider Boot Order:

    • Deferred Providers: If a queue-dependent provider is marked as deferred: true, it may still boot after queues. Avoid this:
      // config/app.php
      'providers' => [
          // Queue-dependent providers should NOT be deferred
          App\Providers\QueueMonitoringProvider::class,
      ],
      
    • Circular Dependencies: Ensure no provider depends on another that requires queues, as boot order may still cause issues.
  2. Queue Bootstrapping:

    • Local Testing: Use --once to test boot order without long-running workers:
      php artisan queue:work --once
      
    • Cloud Queues: Verify cloud connections are established before providers boot by checking logs for connection errors.
  3. Daemon Mode:

    • Resource Usage: Daemon mode may consume more resources. Monitor with:
      php artisan queue:failed-table
      
    • Graceful Shutdown: Ensure workers handle SIGTERM properly for daemonized processes.

Debugging Tips

  • Boot Order Logging:
    • Enable debug mode to log provider boot order:
      APP_DEBUG=true
      
    • Check storage/logs/laravel.log for queue initialization messages.
  • Queue Worker Inspection:
    • Use php artisan queue:failed to debug jobs failing due to boot order issues.
  • Service Provider Debugging:
    • Temporarily add logging to providers to verify boot sequence:
      public function boot()
      {
          Log::info('Queue-dependent provider booting...');
      }
      

Configuration Quirks

  1. Queue Boot Order:

    • Custom Bootstrapping: If you need to customize queue boot order, override the bootQueues method in your AppServiceProvider:
      protected function bootQueues()
      {
          $this->app->booted(function () {
              $this->app['queue']->boot();
          });
      }
      
    • Queue Service Provider: Ensure Illuminate\Queue\QueueServiceProvider is registered early in config/app.php.
  2. Daemonized Workers:

    • PID File: Daemonized workers create a PID file in storage/queue.pid. Monitor for conflicts:
      ps aux | grep queue:work
      
    • Environment Variables: Ensure .env variables are loaded before queue workers start (e.g., QUEUE_CONNECTION).
  3. Cloud Queue Connections:

    • Connection Timeouts: Cloud queues may have slower boot times. Increase timeout in config/queue.php:
      'timeout' => 60,
      

NO_UPDATE_NEEDED would not apply here due to the meaningful changes in boot order and queue initialization. The above is the updated assessment.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope
anil/file-picker
broqit/fields-ai