فهرست ها

AI Assisted Development

Introduction

Laravel is uniquely positioned to be the best framework for AI assisted and agentic development. The rise of AI coding agents like Claude Code, OpenCode, Cursor, and GitHub Copilot has transformed how developers write code. These tools can generate entire features, debug complex issues, and refactor code at unprecedented speed - but their effectiveness depends heavily on how well they understand your codebase.

Why Laravel for AI Development?

Laravel's opinionated conventions and well-defined structure make it an ideal framework for AI assisted development. When you ask an AI agent to add a controller, it knows exactly where to place it. When you need a new migration, the naming conventions and file locations are predictable. This consistency eliminates the guesswork that often trips up AI tools in more flexible frameworks.

Beyond file organization, Laravel's expressive syntax and comprehensive documentation give AI agents the context they need to generate accurate, idiomatic code. Features like Eloquent relationships, form requests, and middleware follow patterns that agents can reliably understand and replicate. The result is AI-generated code that looks like it was written by a seasoned Laravel developer, not stitched together from generic PHP snippets.

Laravel Boost

Laravel Boost bridges the gap between AI coding agents and your Laravel application. Boost is an MCP (Model Context Protocol) server equipped with over 15 specialized tools that provide AI agents with deep insight into your application's structure, database, routes, and more. When you install Boost, your AI agent transforms from a general-purpose code assistant into a Laravel expert that understands your specific application.

Boost provides three major capabilities: a suite of MCP tools for inspecting and interacting with your application, composable AI guidelines crafted specifically for the Laravel ecosystem, and a powerful documentation API containing over 17,000 pieces of Laravel-specific knowledge.

Installation

Boost can be installed in Laravel 10, 11, 12, and 13 applications running PHP 8.1 or higher. To get started, install Boost as a development dependency:


composer require laravel/boost --dev

Once installed, run the interactive installer:


php artisan boost:install

The installer will auto-detect your IDE and AI agents, allowing you to select the integrations that make sense for your project. Boost will generate the necessary configuration files, such as .mcp.json for MCP-compatible editors and guideline files for AI context.

[!NOTE]

Generated configuration files like .mcp.json, CLAUDE.md, and boost.json can be safely added to your .gitignore if you prefer each developer to configure their own environment.

Available Tools

Boost exposes a comprehensive set of tools to AI agents via the Model Context Protocol. These tools allow agents to deeply understand and interact with your Laravel application:

  • Application Introspection - Query your PHP and Laravel versions, list installed packages, and inspect your application's configuration and environment variables.

  • Database Tools - Inspect your database schema, execute read-only queries, and understand your data structure without leaving the conversation.

  • Route Inspection - List all registered routes with their middleware, controllers, and parameters.

  • Artisan Commands - Discover available Artisan commands and their arguments, enabling agents to suggest and execute the right commands for your task.

  • Log Analysis - Read and analyze your application's log files to help debug issues.

  • Browser Logs - Access browser console logs and errors when developing with Laravel's frontend tools.

  • Tinker Integration - Execute PHP code in the context of your application via Laravel Tinker, allowing agents to test hypotheses and verify behavior.

  • Documentation Search - Search Laravel ecosystem documentation with results tailored to your installed package versions.

AI Guidelines

Boost includes a comprehensive set of AI guidelines specifically crafted for the Laravel ecosystem. These guidelines teach AI agents how to write idiomatic Laravel code, follow framework conventions, and avoid common pitfalls. Guidelines are composable and version-aware, meaning agents receive instructions appropriate for your exact package versions.

Guidelines are available for Laravel itself and over 16 packages in the Laravel ecosystem, including:

  • Livewire (2.x, 3.x, and 4.x)

  • Inertia.js (React, Svelte, and Vue variants)

  • Tailwind CSS (3.x and 4.x)

  • Filament (3.x and 4.x)

  • PHPUnit

  • Pest PHP

  • Laravel Pint

  • And many more

When you run boost:install, Boost automatically detects which packages your application uses and assembles the relevant guidelines into your project's AI context files.

Agent Skills

Agent Skills are lightweight, targeted knowledge modules that agents can activate on-demand when working on specific domains. Unlike guidelines, which are loaded upfront, skills allow detailed patterns and best practices to be loaded only when relevant, reducing context bloat and improving the relevance of AI-generated code.

Skills are available for popular Laravel packages like Livewire, Inertia, Tailwind CSS, Pest, and more. When you run boost:install and select skills as a feature, skills are automatically installed based on the packages detected in your composer.json.

Documentation Search

Boost includes a powerful documentation API that gives AI agents access to over 17,000 pieces of Laravel ecosystem documentation. Unlike generic web searches, this documentation is indexed, vectorized, and filtered to match your exact package versions.

When an agent needs to understand how a feature works, it can search Boost's documentation API and receive accurate, version-specific information. This eliminates the common problem of AI agents suggesting deprecated methods or syntax from older framework versions.

Agents Integration

Boost integrates with popular IDEs and AI tools that support the Model Context Protocol. For detailed setup instructions for Cursor, Claude Code, Codex, Gemini CLI, GitHub Copilot, and Junie, see the Set Up Your Agents section of the Boost documentation.

مقدمه

لاراول به شکل منحصر‌به‌فردی در جایگاهی قرار دارد که می‌تواند بهترین فریم‌ورک برای توسعه‌های مبتنی بر هوش مصنوعی (AI-assisted) و ایجنت‌محور (Agentic) باشد. ظهور ایجنت‌های برنامه‌نویسی هوش مصنوعی نظیر Claude Code، OpenCode، Cursor و GitHub Copilot، شیوه کدنویسی توسعه‌دهندگان را متحول کرده است. این ابزارها قادرند قابلیت‌های کامل را ایجاد کنند، مشکلات پیچیده را دیباگ کنند و کدها را با سرعتی بی‌سابقه بازنویسی (Refactor) کنند؛ اما کارایی آن‌ها به شدت به میزان درک‌شان از «کدبیس» (Codebase) یا پایگاه کد شما بستگی دارد.

چرا لاراول برای توسعه هوش مصنوعی مناسب است؟

قوانین و قراردادهای مشخص (Opinionated conventions) و ساختارِ دقیقِ لاراول، آن را به فریم‌ورکی ایده‌آل برای توسعه به کمک هوش مصنوعی تبدیل کرده است. وقتی از یک ایجنت هوش مصنوعی می‌خواهید یک کنترلر جدید اضافه کند، این ایجنت دقیقاً می‌داند که آن را کجا قرار دهد. زمانی که به یک Migration جدید نیاز دارید، قراردادهای نام‌گذاری و محل قرارگیری فایل‌ها کاملاً قابل پیش‌بینی هستند. این ثبات و یکپارچگی، حدس و گمان‌هایی را که معمولاً در فریم‌ورک‌های منعطف‌تر باعث خطا در ابزارهای هوش مصنوعی می‌شوند، از بین می‌برد.

فراتر از سازمان‌دهی فایل‌ها، نحو (Syntax) رسا و مستندات جامع لاراول، بستری از اطلاعات (Context) مورد نیاز را در اختیار ایجنت‌های هوش مصنوعی قرار می‌دهد تا بتوانند کدهایی دقیق و استاندارد تولید کنند. ویژگی‌هایی مانند روابط Eloquent، فرم‌ریکوئست‌ها (Form Requests) و میان‌افزارها (Middleware)، از الگوهایی پیروی می‌کنند که ایجنت‌ها می‌توانند به شکلی قابل‌اطمینان آن‌ها را درک و پیاده‌سازی کنند. نتیجه این کار، تولید کدهایی توسط هوش مصنوعی است که گویی توسط یک توسعه‌دهنده باتجربه لاراول نوشته شده‌اند، نه کدهایی که صرفاً از تکه‌های عمومی (Generic) پی‌اچ‌پی به هم دوخته شده باشند.

لاراول بوست (Laravel Boost)

لاراول بوست شکاف میان ایجنت‌های برنامه‌نویسی هوش مصنوعی و اپلیکیشن لاراول شما را پر می‌کند. Boost یک سرور MCP (Model Context Protocol) است که به بیش از ۱۵ ابزار تخصصی مجهز شده و به ایجنت‌های هوش مصنوعی دیدی عمیق نسبت به ساختار اپلیکیشن، پایگاه داده، مسیرها (routes) و موارد دیگر می‌دهد. با نصب Boost، ایجنت هوش مصنوعی شما از یک دستیار کدنویسی عمومی به یک متخصص لاراول تبدیل می‌شود که اپلیکیشن خاص شما را به‌خوبی می‌شناسد.

Boost سه قابلیت اصلی ارائه می‌دهد: مجموعه‌ای از ابزارهای MCP برای بررسی و تعامل با اپلیکیشن شما، راهنماهای هوش مصنوعی قابل ترکیب که به‌طور ویژه برای اکوسیستم لاراول طراحی شده‌اند، و یک API قدرتمند مستندات که شامل بیش از ۱۷٬۰۰۰ بخش از دانش مخصوص لاراول است.

نصب

Boost می‌تواند روی اپلیکیشن‌های لاراول نسخه‌های ۱۰، ۱۱، ۱۲ و ۱۳ که از PHP 8.1 یا بالاتر استفاده می‌کنند، نصب شود. برای شروع، Boost را به عنوان یک وابستگی توسعه (development dependency) نصب کنید:

composer require laravel/boost --dev

پس از نصب، نصب‌کننده تعاملی (interactive installer) را اجرا کنید:

php artisan boost:install

این نصب‌کننده به صورت خودکار IDE و ایجنت‌های هوش مصنوعی شما را شناسایی می‌کند و به شما اجازه می‌دهد تا ادغام‌های (integrations) مناسب برای پروژه خود را انتخاب کنید. Boost فایل‌های پیکربندی لازم، مانند .mcp.json برای ویرایشگرهای سازگار با MCP و فایل‌های راهنما (guideline) برای ایجاد Context (زمینه) برای هوش مصنوعی را تولید خواهد کرد.

نکته فایل‌های پیکربندی تولید شده مانند .mcp.json ،CLAUDE.md و boost.json را می‌توانید با خیال راحت به .gitignore خود اضافه کنید، اگر ترجیح می‌دهید هر توسعه‌دهنده محیط کاری شخصی خود را پیکربندی کند.

ابزارهای در دسترس

Boost مجموعه‌ای جامع از ابزارها را از طریق پروتکل متن (Model Context Protocol) در اختیار ایجنت‌های هوش مصنوعی قرار می‌دهد. این ابزارها به ایجنت‌ها اجازه می‌دهند تا به شکلی عمیق، اپلیکیشن لاراول شما را درک کرده و با آن تعامل داشته باشند:

  • بازرسی اپلیکیشن (Application Introspection): پرس‌وجو درباره نسخه‌های PHP و لاراول، لیست کردن پکیج‌های نصب‌شده، و بررسی پیکربندی و متغیرهای محیطی (environment variables) اپلیکیشن.
  • ابزارهای پایگاه داده (Database Tools): بررسی شمای پایگاه داده، اجرای کوئری‌های فقط‌خواندنی (read-only)، و درک ساختار داده‌ها بدون نیاز به خروج از محیط گفتگو.
  • بازرسی مسیرها (Route Inspection): مشاهده لیست تمامی مسیرهای ثبت‌شده (routes) به همراه میدل‌ورها (middleware)، کنترلرها و پارامترهای آن‌ها.
  • دستورات آرتیزان (Artisan Commands): شناسایی دستورات موجود در Artisan به همراه آرگومان‌های آن‌ها، که به ایجنت‌ها امکان می‌دهد دستورات صحیح را برای وظیفه شما پیشنهاد داده و اجرا کنند.
  • تحلیل لاگ (Log Analysis): خواندن و تحلیل فایل‌های لاگ اپلیکیشن برای کمک به عیب‌یابی (debug) مشکلات.
  • لاگ‌های مرورگر (Browser Logs): دسترسی به لاگ‌های کنسول مرورگر و خطاها هنگام توسعه با ابزارهای فرانت‌اند لاراول.
  • یکپارچه‌سازی با Tinker: اجرای کد PHP در کانتکست (context) اپلیکیشن از طریق Laravel Tinker، که به ایجنت‌ها اجازه می‌دهد فرضیات خود را آزمایش و رفتار کد را تأیید کنند.
  • جستجوی مستندات (Documentation Search): جستجو در مستندات اکوسیستم لاراول با نتایجی که دقیقاً متناسب با نسخه‌های پکیج‌های نصب‌شده شما تنظیم شده‌اند.

راهنماهای هوش مصنوعی (AI Guidelines)

Boost مجموعه‌ای جامع از راهنماهای هوش مصنوعی را در بر دارد که به‌طور ویژه برای اکوسیستم لاراول طراحی شده‌اند. این راهنماها به ایجنت‌های هوش مصنوعی می‌آموزند که چگونه کدی استاندارد و اصولی (Idiomatic) به سبک لاراول بنویسند، از قراردادهای (Conventions) فریم‌ورک پیروی کنند و از اشتباهات رایج اجتناب ورزند. این راهنماها قابلیت ترکیب شدن (Composable) دارند و از نسخه پکیج‌های شما آگاه هستند؛ به این معنا که ایجنت‌ها دستورالعمل‌هایی را دریافت می‌کنند که دقیقاً با نسخه پکیج‌های نصب‌شده در پروژه شما مطابقت دارد.

این راهنماها برای هسته لاراول و بیش از ۱۶ پکیج در اکوسیستم آن در دسترس هستند، از جمله:

  • Livewire (نسخه‌های 2.x، 3.x و 4.x)
  • Inertia.js (نسخه‌های React، Svelte و Vue)
  • Tailwind CSS (نسخه‌های 3.x و 4.x)
  • Filament (نسخه‌های 3.x و 4.x)
  • PHPUnit
  • Pest PHP
  • Laravel Pint
  • و بسیاری موارد دیگر.

هنگامی که دستور boost:install را اجرا می‌کنید، Boost به‌طور خودکار تشخیص می‌دهد که اپلیکیشن شما از چه پکیج‌هایی استفاده می‌کند و راهنماهای مرتبط را در فایل‌های کانتکست (context) هوش مصنوعی پروژه شما جمع‌آوری و تدوین می‌کند.

مهارت‌های ایجنت (Agent Skills)

«مهارت‌های ایجنت» ماژول‌های دانشِ سبک‌بالا و هدفمندی هستند که ایجنت‌ها می‌توانند هنگام کار روی حوزه‌های تخصصی، آن‌ها را بر حسب نیاز (on-demand) فعال کنند. برخلاف «راهنماها» (Guidelines) که از همان ابتدا بارگذاری می‌شوند، «مهارت‌ها» اجازه می‌دهند تا الگوهای دقیق و بهترین روش‌ها (Best Practices) تنها زمانی که مرتبط هستند بارگذاری شوند؛ این کار باعث کاهش حجم اضافی کانتکست (Context Bloat) شده و دقت و مرتبط بودن کدی که توسط هوش مصنوعی تولید می‌شود را بهبود می‌بخشد.

مهارت‌ها برای پکیج‌های محبوب لاراول مانند Livewire، Inertia، Tailwind CSS، Pest و موارد دیگر در دسترس هستند. هنگامی که دستور boost:install را اجرا می‌کنید و گزینه انتخاب مهارت‌ها (skills) را به عنوان یک قابلیت انتخاب می‌کنید، این مهارت‌ها به‌طور خودکار بر اساس پکیج‌های شناسایی‌شده در فایل composer.json شما نصب می‌شوند.

جست‌وجوی مستندات (Documentation Search)

Boost یک API قدرتمند برای مستندات در اختیار دارد که به ایجنت‌های هوش مصنوعی دسترسی به بیش از ۱۷٬۰۰۰ بخش از مستندات اکوسیستم لاراول می‌دهد. برخلاف جست‌وجوی عمومی وب، این مستندات ایندکس و بردارسازی (vectorized) شده‌اند و بر اساس نسخه‌های دقیق پکیج‌های شما فیلتر می‌شوند.

وقتی یک ایجنت بخواهد بفهمد یک قابلیت چگونه کار می‌کند، می‌تواند در API مستندات Boost جست‌وجو کند و اطلاعاتی دقیق و متناسب با نسخه همان پکیج دریافت کند. این کار مشکل رایج پیشنهاد شدن متدهای منسوخ یا سینتکس نسخه‌های قدیمی را از سوی ایجنت‌های هوش مصنوعی برطرف می‌کند.

یکپارچه‌سازی ایجنت‌ها (Agents Integration)

Boost به‌راحتی با IDEها و ابزارهای هوش مصنوعی محبوبی که از «پروتکل کانتکست مدل» (Model Context Protocol - MCP) پشتیبانی می‌کنند، یکپارچه می‌شود. برای مشاهده دستورالعمل‌های دقیق جهت راه‌اندازی و تنظیمات در ابزارهایی نظیر Cursor، Claude Code، Codex، Gemini CLI، GitHub Copilot و Junie، می‌توانید به بخش «Set Up Your Agents» در مستندات رسمی Boost مراجعه کنید.