mcpField
L
laravel-performance-select-columns

laravel-performance-select-columns

github.com/noartemDevelopment1375 installsUpdated 2w ago
Repository

About laravel-performance-select-columns

A Laravel performance skill for developers optimizing database queries by selecting only the fields an application needs. It also emphasizes eager loading and keeping data resources aligned with query results.

Key features

  1. 01Select specific query columns
  2. 02Select relation columns with eager loading
  3. 03Align DTOs and resources with selected fields
  4. 04Avoid selecting all columns

Use cases

  1. 01Reduce query payloads in paginated results
  2. 02Load only needed fields from related models
  3. 03Avoid N+1 queries with eager loading

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/noartem/skills --skill laravel-performance-select-columns

After installing, type/laravel-performance-select-columnsin Claude Code to confirm it loaded.

Details

From the project README

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

Comments

Markdown supported