- What’s the latest Laravel version and how do I install it via Composer?
- The latest stable Laravel version is **13.4.0** (as of the latest TPM assessment). Install it via Composer using `composer create-project laravel/laravel project-name 13.4.*` or update an existing project with `composer require laravel/framework:^13.4`. Ensure PHP 8.2+ is installed first, as Laravel 13+ requires it.
- How does Laravel’s new #[Delay] attribute for queues improve job scheduling?
- The #[Delay] attribute (introduced in Laravel 13.4) replaces string-based delays (e.g., `delay(60)`) with type-safe annotations, improving reliability and debugging. It integrates with the Bus Dispatcher and NotificationSender, reducing boilerplate and enabling better inspection via Artisan commands like `queue:inspect`. Legacy code may need updates to adopt this syntax.
- What’s the impact of Laravel’s strict mode for FormRequest validation?
- Strict mode in FormRequest (PR #59430) enforces type safety for rules like `starts_with`/`ends_with`, reducing runtime errors with null/non-string inputs. It’s opt-in and may break existing validation logic if not tested. Useful for high-security apps but requires testing in CI/CD pipelines to avoid regressions.
- Does Laravel 13.4 support PHP 8.1, or is PHP 8.2+ mandatory?
- Laravel 13.4 **requires PHP 8.2+** due to its use of modern features like enums, attributes, and readonly properties. PHP 8.1 is unsupported, and downgrading may break functionality. Check your server’s PHP version with `php -v` before installing.
- How can I test Laravel’s new queue inspection methods in a CI pipeline?
- Use Laravel’s `flushState()` method for FormRequest tests to isolate state between runs, and leverage `queue:inspect` Artisan commands to verify job delays and payloads. Mock Redis or database queues in tests with `Queue::fake()` and assert job execution. Example: `Queue::assertPushed(YourJob::class, fn ($job) => $job->delay === 60);`.
- What are the performance implications of enabling strict validation in production?
- Strict validation in FormRequest adds runtime checks, which may introduce **minor overhead** (e.g., 5–10% slower request processing in high-volume APIs). Benchmark with Laravel Octane or Sentry to measure impact. For most applications, the trade-off for security and consistency is negligible, but disable it in performance-critical paths if needed.
- How do I migrate from string-based queue delays (e.g., `delay(60)`) to #[Delay]?
- Replace `delay(60)` with `#[Delay(seconds: 60)]` above your job class or method. For notifications, use `#[Delay(seconds: 60)]` on the `send()` method. Run `composer dump-autoload` after changes. Use Artisan’s `queue:inspect` to verify delays are applied correctly.
- Are there alternatives to Laravel’s queue system for high-throughput applications?
- For high-throughput queues, consider **Spatie’s queue-scheduler** (for cron-like jobs) or **Laravel Horizon** (for monitoring). For non-Laravel alternatives, **Symfony Messenger** or **RabbitMQ with PHP AMQP** offer scalability. Laravel’s queue system is optimized for simplicity, but Horizon adds Redis-based monitoring for production workloads.
- How does Laravel’s Carbon overflow option fix date arithmetic edge cases?
- The new `Carbon::parse()->addDays(1)->overflow()` option (PR #59509) prevents integer overflows in date calculations, critical for financial systems or scheduling. For example, adding days to a date near `PHP_INT_MAX` will now handle overflow gracefully instead of crashing. Test with extreme dates (e.g., `2038-01-19`) to verify fixes.
- What should I do if my Redis sessions are failing after the Laravel 13.4 update?
- The Redis connection fix was reverted in PR #59542, which may cause issues in high-concurrency apps. Monitor memory usage and test under load. If problems persist, explicitly configure Redis connections in `config/database.php` or downgrade to Laravel 13.3.x temporarily. Check logs for `Redis::connection()` errors.