用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/pluginagentmarketplace/custom-plugin-php --skill php-laravel命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | php-laravel |
| version | 2.0.0 |
| description | Laravel framework mastery - Eloquent, Blade, APIs, queues, and Laravel 11.x ecosystem |
| sasmp_version | 1.3.0 |
| bonded_agent | 02-php-laravel |
| bond_type | PRIMARY_BOND |
| atomic | true |
| category | framework |
Atomic skill for mastering Laravel application development
Comprehensive skill for building production-ready Laravel applications. Covers Laravel 10.x-11.x with focus on Eloquent ORM, Blade templating, API development, and queues.
interface SkillParams {
topic:
| "eloquent" // ORM, relationships, queries
| "routing" // Routes, middleware, controllers
| "blade" // Templates, components, layouts
| "authentication" // Sanctum, Passport, Fortify
| "queues" // Jobs, workers, Horizon
| "testing" // Feature tests, factories
| "api"; // API resources, versioning
level: "beginner" | "intermediate" | "advanced";
laravel_version?: "10" | "11";
stack?: "livewire" | "inertia-vue" | "inertia-react" | "blade-only";
}
validation:
topic:
required: true
allowed: [eloquent, routing, blade, authentication, queues, testing, api]
level:
required: true
laravel_version:
default: "11"
beginner:
- Model basics and conventions
- CRUD operations
- Basic relationships
intermediate:
- Advanced relationships (morphTo, hasManyThrough)
- Eager loading and N+1 prevention
- Query scopes
advanced:
- Custom casts and accessors
- Performance optimization
- Database transactions
exercises:
- Build blog with posts, comments, tags
- Implement soft deletes
- Create polymorphic media system
beginner:
- API routes and controllers
- JSON responses
- Basic authentication (Sanctum)
intermediate:
- API Resources and Collections
- Pagination and filtering
- Rate limiting
advanced:
- OAuth with Passport
- API versioning patterns
- OpenAPI documentation
beginner:
- Job basics and dispatching
- Queue connections
- Failed jobs handling
intermediate:
- Job chaining and batching
- Horizon monitoring
advanced:
- Custom queue drivers
- Saga patterns
graph TD
A[Skill Invoked] --> B{Validate Params}
B -->|Invalid| C[Return Error]
B -->|Valid| D{Check Laravel Version}
D --> E[Load Version-Specific Content]
E --> F{Topic Router}
F --> G[Generate Examples + Exercises]
errors:
VERSION_INCOMPATIBLE:
code: "LARAVEL_001"
recovery: "Suggest upgrade or alternative"
PACKAGE_MISSING:
code: "LARAVEL_002"
recovery: "Provide composer require command"
retry:
max_attempts: 3
backoff:
type: exponential
initial_delay_ms: 100
<?php
declare(strict_types=1);
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
final class Post extends Model
{
use HasFactory;
protected $fillable = ['title', 'slug', 'content', 'author_id'];
protected function casts(): array
{
return [
'published_at' => 'datetime',
];
}
public function author():
{
->(::, );
}
{
->(::);
}
{
->();
}
}
<?php
declare(strict_types=1);
namespace App\Http\Controllers\Api\V1;
use App\Http\Controllers\Controller;
use App\Http\Resources\PostResource;
use App\Models\Post;
use Illuminate\Http\Response;
final class PostController extends Controller
{
public function index()
{
return PostResource::collection(
Post::with(['author'])->paginate(15)
);
}
public function store(StorePostRequest $request)
{
$post = Post::create($request->());
( ())
->()
->(::);
}
}
<?php
declare(strict_types=1);
namespace App\Jobs;
use App\Models\User;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\Middleware\WithoutOverlapping;
final class SendWelcomeEmail implements ShouldQueue
{
use Queueable, InteractsWithQueue;
public int $tries = 3;
public int $backoff = 60;
public function __construct(
public readonly User $user,
) {}
public function middleware():
{
[ (->user->id)];
}
{
->user->( ());
}
}
<?php
declare(strict_types=1);
namespace Tests\Feature\Api;
use App\Models\Post;
use App\Models\User;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Laravel\Sanctum\Sanctum;
use Tests\TestCase;
final class PostApiTest extends TestCase
{
use RefreshDatabase;
public function test_can_list_posts(): void
{
Post::factory()->count(5)->create();
$this->getJson('/api/v1/posts')
->assertOk()
->assertJsonCount(5, 'data');
}
public ():
{
::(::()->());
->(, [ => ])
->();
}
}
| Problem | Solution |
|---|---|
| N+1 queries | Use with() for eager loading |
| Queue jobs stuck | Check QUEUE_CONNECTION, run queue:work |
| Route not found | Run route:clear, check middleware |
| Metric | Target |
|---|---|
| Code accuracy | 100% |
| Laravel conventions | 100% |
| N+1 prevention | 100% |
Skill("php-laravel", {topic: "eloquent", level: "intermediate"})