Audit your codebase with Laravel Boost Laravel Boost recently introduced a game-changing AI skill: **laravel-best-practices**. This tool isn't just a static linter; it’s an active agent that consults 189 specific rules across database performance, security, and Eloquent usage. Whether you are scaffolding a fresh Laravel project or auditing an older vibe-coded legacy application, this skill ensures your code adheres to modern ecosystem standards from the first line of code. Prerequisites and Tooling Setup To use these skills, you need a working knowledge of the Laravel framework and a CLI-based AI agent like Claude Code. You should be comfortable with terminal commands and composer-based installations. Key Libraries & Tools * **Laravel Boost**: A CLI tool that configures your development environment with specific AI skills. * **Claude Code**: The underlying AI agent that executes the analysis and code generation. * **laravel-best-practices**: The official skill containing rules for migrations, routing, and controllers. * **Laravel Daily Structure Audit**: A custom skill focused on architectural logic placement. Implementation and Skill Activation When installing Laravel, selecting the **Boost** option automatically injects the best practices skill. For existing projects, running `composer update` to reach version **2.4.1** or higher is necessary. Once active, you can prompt Claude Code to analyze your directory. The agent uses parallel sub-agents to read the 189 rule points without blowing through your token context window. ```bash Update and install the new skill on an existing project composer update boost install ``` Practical Syntax and Patterns The skill actively enforces patterns that prevent common technical debt. For example, it checks migrations for proper indexing and foreign key constraints: ```php // The skill ensures these patterns are used in generated code Schema::table('bookings', function (Blueprint $table) { $table->foreignId('user_id')->constrained()->cascadeOnDelete(); $table->unique(['user_id', 'service_id']); }); ``` In controllers, it pushes for **Form Requests** and **Route Model Binding** to keep methods clean. If you're building a CRUD, the AI uses `Route::resource` by default, ensuring your routing file doesn't become a bloated mess of individual GET and POST definitions. Insights from Real-World Audits In a test on a project upgraded to **Laravel 13**, the skill identified 32 issues, including eight high-severity points like missing rate limiting and **N+1 query** vulnerabilities. Interestingly, it even flagged errors in code previously generated by AI, such as a lack of error handling on **Stripe API** calls. This demonstrates that even AI-generated code requires a specialized "best practice" layer to be production-ready.
Taylor%20Otwell
People
The Laravel channel (5 mentions) praises his architectural vision in "Live Q&A re: $57M fundraise" while Laravel Daily (1 mention) tests his new "official skill" tool.
- Mar 27, 2026
- Apr 30, 2025
- Dec 18, 2024
- Sep 5, 2024
- Apr 18, 2024
The Versatile Number Helper Laravel version 10.33 introduced a robust `Number` helper that simplifies complex formatting into readable strings. This utility replaces manual calculations and locale-specific logic with a clean, fluent API. You can easily convert large integers into shorter, human-readable versions like "12.8 million" using the `forHumans` method. ```php use Illuminate\Support\Number; // Basic formatting with locale support $formatted = Number::format(12756800, locale: 'de'); // Human-readable abbreviations $short = Number::forHumans(12756800, precision: 2); // "12.76 million" ``` The helper also includes built-in support for currencies, percentages, and file sizes. For instance, `Number::fileSize(1024 * 1024)` automatically returns "1 MB," handling the heavy lifting of byte conversion while allowing for custom precision. Hex Color Validation Made Simple Handling design-related inputs just became significantly safer. Nico contributed a new `hex_color` validation rule that ensures a given string is a valid hexadecimal color code. This is a massive improvement over basic string checks, as it verifies the structure and character range (0-9, A-F). ```php $validator = Validator::make($request->all(), [ 'color' => 'required|hex_color', ]); ``` The rule elegantly handles standard hex codes and those including an alpha channel (RGBA), rejecting invalid characters like "G" or incorrect lengths automatically. Testing Job Batches in Chains Complex asynchronous workflows often involve job batches nested inside larger job chains. Testing these used to be difficult, but Taylor Otwell added a specialized assertion to the `Bus` fake. The `busChainBatch` method allows you to inspect the contents of a batch within a chain using a closure. ```php Bus::fake(); // ... dispatch your chain ... Bus::assertChain([ FlushCache::class, Bus::chainBatch(function ($batch) { return count($batch->jobs) === 2 && $batch->jobs[0]->podcastId === 1; }), ]); ``` Syntax Notes and Best Practices When using the `Number` helper, always specify a locale if your application serves international users, as number separators vary drastically between regions like the US and Germany. For testing batches, remember that `busChainBatch` requires a boolean return; if your closure returns `false`, the entire test fails. This methodical approach ensures your background processes are not just running, but running with the correct payload.
Nov 23, 2023