mcpField
L
laravel:custom-helpers

laravel:custom-helpers

github.com/jpcaparasDevelopment157114 installsUpdated 19w ago
Repository

About laravel:custom-helpers

A Laravel skill for adding custom PHP helper functions and autoloading them through Composer. It also recommends keeping helpers small and free of hidden I/O or state.

Key features

  1. 01Create PHP helper files
  2. 02Register helpers in Composer
  3. 03Regenerate the autoloader
  4. 04Keep helpers small and pure
  5. 05Prefer value-object methods for domain logic

Use cases

  1. 01Adding a reusable formatting function
  2. 02Autoloading project helper functions
  3. 03Deciding whether logic belongs in a helper or value object

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/jpcaparas/superpowers-laravel --skill laravel:custom-helpers

After installing, type/laravel:custom-helpersin Claude Code to confirm it loaded.

Details

From the project README

Custom Helpers

Create a helper file

// app/Support/helpers.php
function money(int $cents): string { return number_format($cents / 100, 2); }

Autoload

Add to composer.json:

{
  "autoload": { "files": ["app/Support/helpers.php"] }
}

Run composer dump-autoload.

Guidelines

  • Keep helpers small and pure; avoid hidden IO/state
  • Prefer static methods on value objects when domain-specific

Comments

Markdown supported