npx skills add smithery/neversight --skill laravel-api-resources-and-pagination
noartem/skills
laravel-api-resources-and-pagination
Use API Resources with pagination and conditional fields; keep response shapes stable and cache-friendly
Installation
npx skills add noartem/skills --skill laravel-api-resources-and-pagination
Similar popular skills
Related neighbors and high-traction skills in the same topics — useful to compare before installing.
Implement efficient pagination strategies for large datasets using offset/limit, cursor-based, …
470 installsImplements efficient API pagination using offset, cursor, and keyset strategies for large datas…
367 installsUse API Resources with pagination and conditional fields; keep response shapes stable and cache…
127 installsAlso in this package
Other skills from noartem/skills · top by installs.
npx skills add noartem/skills
More details
Agent compatibility
Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.
Also listed on
Alternate registries and mirrors of this skill.
Repository health
main
Package contents
Files included with this skill beyond the listing page.
-
skill md
SKILL.md1,040 B -
docs
SUMMARY.md148 B
History
- First seen on skills.sh
- First recorded snapshot · 69 installs
SKILL.md
API Resources and Pagination
Represent models via Resources; keep transport concerns out of Eloquent.
Commands
# 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(),
];
}
Patterns
- Prefer
Resource::collection($query->paginate())over manual arrays - Use
when()/mergeWhen()for conditional fields - Keep pagination cursors/links intact for clients
- Version resources when contracts change; avoid breaking fields silently