0063-laravel-performance-select-columns
CommunityTrim payloads by selecting only needed columns
System Documentation
What problem does it solve?
Large, unfiltered database selects in Laravel increase memory usage and slow down API responses by transferring and hydrating more data than you actually need.
Core Features & Use Cases
- Select only required columns in base queries to reduce payload size and improve performance.
- Apply column selection to eager-loaded relations to avoid unnecessary data transfer and keep N+1 issues under control.
- Keep DTOs/resources aligned with the selected fields so you don’t accidentally rely on attributes you didn’t fetch.
Example: In an endpoint that returns paginated users and includes each user’s author details for related posts, selecting only id, name, and the specific post fields prevents returning unused columns while still supporting with() eager loading.
Quick Start
Ask the AI how to update your Eloquent queries and with() relations to use select() so your responses only include the exact fields you need.
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: 0063-laravel-performance-select-columns Download link: https://github.com/MrJmpl3/codex_____data_____configuration/archive/main.zip#0063-laravel-performance-select-columns Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.