技能创建器
skill-creator
创建、改进和评估自定义技能,把专业流程转化为可重复使用的 AI 能力。
laravel-eloquent【数据与研究】Write performant Eloquent queries with eager loading, reusable scopes, and strict lazy-loading prevention in Laravel. Use when defining model relationships, creating query scopes, or processing large datasets with chunk/cursor.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
$fillable, $casts, and relationships.Model::preventLazyLoading(!app()->isProduction()) in AppServiceProvider.scopeActive(), scopeVerified() for reusable filters.with() for all relationship access.chunk() or cursor() instead of get().See implementation examples for model scopes, eager loading, and directory structure.
with() or $with for relationships. Never access relationship properties in loop without eager loading (N+1 Prevention).Model::preventLazyLoading(!app()->isProduction()) in AppServiceProvider::boot() to throw LazyLoadingViolationException in local/dev.chunk(), lazy(), or cursor() for processing many records without memory issues (Memory Efficiency).scopeName(Builder $query): Builder methods in models for reusable query filters.User::active()->verified()->get()) to keep controllers from duplicating query logic.protected $fillable array; use $request->validated() for Model::create().protected $casts for dates, JSON, and custom types to ensure data consistency.with() or $with; never in loops.select *: Specify required columns to limit data transfer.