المهارات laravel-specialist
📦

laravel-specialist

آمن

使用 AI 建構 Laravel 10+ 應用程式

獲得專業的 Laravel 開發協助,包括 Eloquent ORM、REST API、佇列系統和 Livewire 元件。此技能提供建立可擴展 PHP 應用程式的高級指導。

يدعم: Claude Codex Code(CC)
🥉 74 برونزي
1

تنزيل ZIP المهارة

2

رفع في Claude

اذهب إلى Settings → Capabilities → Skills → Upload skill

3

فعّل وابدأ الاستخدام

اختبرها

استخدام "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.

التدقيق الأمني

آمن
v1 • 2/13/2026

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.

6
الملفات التي تم فحصها
2,265
الأسطر التي تم تحليلها
6
النتائج
1
إجمالي عمليات التدقيق
مشكلات متوسطة المخاطر (1)
External Commands Detection - False Positive
Static scanner flagged PHP code blocks as 'Ruby/shell backtick execution'. This is a false positive - the files contain legitimate Laravel PHP code examples, not shell commands.
مشكلات منخفضة المخاطر (5)
Weak Cryptographic Algorithm - False Positive
Scanner flagged 'oldestOfMany()' and similar Laravel methods as 'weak cryptographic algorithm'. This is a false positive - these are standard Eloquent ORM methods.
Environment Variable Access - False Positive
Scanner flagged Laravel env() config calls as 'AWS credential environment variables'. This is standard Laravel configuration pattern - secure by design.
Hardcoded URL - False Positive
Scanner flagged test URLs in Laravel CORS config and HTTP testing. These are test/dummy URLs, not real external calls.
System Reconnaissance - False Positive
Scanner misinterprets Laravel Artisan commands and method names as system reconnaissance.
With Statement Detection - False Positive
Scanner incorrectly flags Laravel's with() eager loading method as Python's deprecated 'with statement'.
تم تدقيقه بواسطة: claude

درجة الجودة

45
الهندسة المعمارية
100
قابلية الصيانة
87
المحتوى
50
المجتمع
90
الأمان
91
الامتثال للمواصفات

ماذا يمكنك بناءه

建立新的 Laravel API

使用 Laravel API 資源建立具有驗證、資源轉換器和適當錯誤處理的 RESTful API。

實作複雜的 Eloquent 關聯關係

設計具有 hasMany、belongsToMany、hasOneThrough 和多型關聯的模型,並正確使用預載入。

建立背景任務處理

設定具有重試邏輯、失敗任務處理和批次處理的佇列任務,用於耗時操作。

جرّب هذه الموجهات

建立 Eloquent 模型
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.
建立 API 資源
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.
Livewire 元件
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 加密功能
  • 避免硬編碼設定值 - 應使用環境變數和設定檔

الأسئلة المتكررة

此技能支援哪些 Laravel 版本?
此技能涵蓋 Laravel 10+ 和 PHP 8.2+。包括現代模式如唯讀屬性、枚舉和類型化屬性。
此技能可以為我的程式碼撰寫測試嗎?
是的,此技能提供使用 Pest PHP 或 PHPUnit 撰寫功能測試和單元測試的指導,並包含適當的模擬技術。
此技能有助於 Livewire 開發嗎?
是的,它包含 Livewire 元件、wire:model、操作和即時更新的完整指導。
此技能可以設定驗證機制嗎?
是的,它涵蓋 Laravel Sanctum 用於 SPA 驗證和 API Token 驗證,並包含適當的安全實踐。
此技能涵蓋佇列任務嗎?
是的,它涵蓋任務建立、重試邏輯、失敗任務處理、批次處理和 Horizon 設定。
此技能如何處理資料庫最佳化?
它提供查詢最佳化、預載入、資料庫索引和正確使用範圍查詢的指導,以避免效能問題。

تفاصيل المطور

المؤلف

jeffallan

الترخيص

MIT

مرجع

main

بنية الملفات