> laravel-performance-select-columns

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

fetch
$curl "https://skillshub.wtf/noartem/skills/laravel-performance-select-columns?format=md"
SKILL.mdlaravel-performance-select-columns

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

┌ stats

installs/wk0
░░░░░░░░░░
github stars6
░░░░░░░░░
first seenMar 17, 2026
└────────────

┌ repo

noartem/skills
by noartem
└────────────

┌ tags

└────────────