laravel-specialist
使用 AI 建構 Laravel 10+ 應用程式
獲得專業的 Laravel 開發協助,包括 Eloquent ORM、REST API、佇列系統和 Livewire 元件。此技能提供建立可擴展 PHP 應用程式的高級指導。
تنزيل ZIP المهارة
رفع في Claude
اذهب إلى Settings → Capabilities → Skills → Upload skill
فعّل وابدأ الاستخدام
اختبرها
استخدام "laravel-specialist". Create an Eloquent model for a Blog Post with author relationship and published scope
النتيجة المتوقعة:
A complete PHP model file with HasFactory, SoftDeletes, proper $fillable, $casts, relationships (belongsTo User, hasMany Comments), and a local scope for filtering published posts.
استخدام "laravel-specialist". Build a REST API endpoint for listing posts with pagination
النتيجة المتوقعة:
Controller method using API Resource, proper pagination, and Eloquent withCount for comment totals.
التدقيق الأمني
آمنAll static scanner findings are false positives. The skill contains legitimate Laravel PHP code examples with no security risks. Scanner misidentified PHP syntax as shell commands, Laravel methods as weak crypto, and standard config patterns as credential access.
مشكلات متوسطة المخاطر (1)
مشكلات منخفضة المخاطر (5)
درجة الجودة
ماذا يمكنك بناءه
建立新的 Laravel API
使用 Laravel API 資源建立具有驗證、資源轉換器和適當錯誤處理的 RESTful API。
實作複雜的 Eloquent 關聯關係
設計具有 hasMany、belongsToMany、hasOneThrough 和多型關聯的模型,並正確使用預載入。
建立背景任務處理
設定具有重試邏輯、失敗任務處理和批次處理的佇列任務,用於耗時操作。
جرّب هذه الموجهات
Create an Eloquent model for [ModelName] with relationships to User and Tag models. Include soft deletes, proper casts for dates, and a scope for filtering by status.
Create a Laravel API resource that transforms a Post model with its author and comments. Include proper data type casting and conditional attributes.
Create a Laravel queue job that sends an email notification with retry logic, a unique job ID, and proper timeout configuration.
Create a Livewire component for a post editor with wire:model binding, form validation, and proper error handling.
أفضل الممارسات
- 存取關聯關係時務必使用預載入(with())以避免 N+1 查詢問題
- 使用 API Resources 轉換模型資料以確保 API 回應格式一致
- 讓佇列任務具有冪等性,以便在失敗時安全重試
- 撰寫涵蓋完整請求生命週期的功能測試,而非僅撰寫單元測試
تجنب
- 避免在沒有預載入的情況下於迴圈中使用關聯存取,這會導致 N+1 查詢
- 不要將商業邏輯放在控制器中 - 應使用服務類別
- 不���以未加密方式儲存敏感資料 - 應使用 Laravel 加密功能
- 避免硬編碼設定值 - 應使用環境變數和設定檔