laravel-patterns
Laravel 11+ patterns and conventions. Covers Eloquent, API design, queues, testing, and modern Laravel architecture.
ソース情報
- リポジトリ
- skeletorflet/opencode-kit
- ソースの最終更新活動
- 2026年3月31日 18:16
- 検出された SKILL.md の言語
- 英語
- スター
- 10
- フォーク
- 1
インストール方法
デフォルトでは、最初にソースを確認する Prompt が選択されています。直接コマンドに切り替えるか、ローカルコピーをダウンロードすることもできます。
ソースファイルを確認
インストールを決める前に、SKILL.md と SkillsMP に表示されている付属ファイルをお読みください。
SKILL.md を表示中
SKILL.md
ソースの指示 · 読み取り専用プレビュー- name
- laravel-patterns
- description
- Laravel 11+ patterns and conventions. Covers Eloquent, API design, queues, testing, and modern Laravel architecture.
- license
- MIT
- compatibility
- opencode
- metadata
- {"audience":"developers","category":"backend"}
# Laravel Patterns
## What I Do
- Build Laravel 11+ applications with modern patterns
- Design Eloquent models with proper relationships
- Implement API resources and validation
- Set up queues and job processing
- Write tests with PHPUnit and Pest
## When to Use Me
- Creating or extending Laravel applications
- Designing Eloquent models and relationships
- Building REST APIs with Laravel
- Setting up queue workers and scheduled tasks
- Writing comprehensive tests
## Key Principles
1. **Form Requests**: Validate in FormRequest classes, not controllers
2. **API Resources**: Transform models with API Resources for responses
3. **Eloquent Events**: Use model events for side effects
4. **Service Container**: Leverage DI and service providers
5. **Queues**: Offload slow operations to queue workers
## Common Patterns
### Form Request
```php
class StoreUserRequest extends FormRequest
{
public function rules(): array
{
return [
'name' => ['required', 'string', 'max:255'],
'email' => ['required', 'email', 'unique:users'],
'password' => ['required', 'min:8', 'confirmed'],
];
}
}
```
### API Resource
```php
class UserResource extends JsonResource
{
public function toArray(Request $request): array
{
return [
'id' => $this->id,
'name' => $this->name,
'email' => $this->email,
'created_at' => $this->created_at->toIso8601String(),
];
}
}
```
## Validation
```bash
php artisan migrate
php artisan test
php artisan pint
```
GitHubで見る