laravel-performance-select-columns

star 136

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

jpcaparas By jpcaparas schedule Updated 11/3/2025

name: laravel:performance-select-columns description: Select only required columns to reduce memory and transfer costs; apply to base queries and relations

Select Only Needed Columns

Reduce payloads by selecting exact fields:

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
Install via CLI
npx skills add https://github.com/jpcaparas/superpowers-laravel --skill laravel-performance-select-columns
Repository Details
star Stars 136
call_split Forks 0
navigation Branch main
article Path SKILL.md
More from Creator