# Laravel:performance Select Columns

> Select only required columns to reduce memory and transfer costs; apply to base queries and relations

- Skill: `jpcaparas/laravel-performance-select-columns` (Agent Skill)
- Install (CLI): `npx skillmds@latest add jpcaparas/laravel-performance-select-columns`
- Raw SKILL.md: https://api.skillmd.com/api/skills/jpcaparas/laravel-performance-select-columns/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: jpcaparas (https://skillmd.com/u/jpcaparas)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/jpcaparas/laravel-performance-select-columns

---


# Select Only Needed Columns

Reduce payloads by selecting exact fields:

```php
User::select(['id', 'name'])->paginate();

Post::with(['author:id,name'])->select(['id','author_id','title'])->get();
```

- Avoid `*`; keep DTOs/resources aligned with selected fields
- Combine with eager loading to avoid N+1


