From noartem-laravel-vue-skills
Use API Resources with pagination and conditional fields; keep response shapes stable and cache-friendly
How this skill is triggered — by the user, by Claude, or both
Slash command
/noartem-laravel-vue-skills:laravel-api-resources-and-paginationThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Represent models via Resources; keep transport concerns out of Eloquent.
Represent models via Resources; keep transport concerns out of Eloquent.
# Resource
php artisan make:resource PostResource # or: php artisan make:resource PostResource
# Controller usage
return PostResource::collection(
Post::with('author')->latest()->paginate(20)
);
# Resource class
public function toArray($request)
{
return [
'id' => $this->id,
'title' => $this->title,
'author' => new UserResource($this->whenLoaded('author')),
'published_at' => optional($this->published_at)->toAtomString(),
];
}
Resource::collection($query->paginate()) over manual arrayswhen() / mergeWhen() for conditional fieldsnpx claudepluginhub noartem/skillsGuides completion of development work by verifying tests, detecting environment, and presenting structured options for merge, PR, or cleanup.
Enforces test-driven development: write failing test first, then minimal code to pass. Use when implementing features or bugfixes.
Guides creation and editing of skills using test-driven development with pressure scenarios and subagents to verify agent compliance.