About laravel-custom-helpers
A short Laravel development skill for developers adding custom PHP helper functions to an application. It covers creating a helper file, Composer autoload configuration, and guidelines for keeping helpers small and stateless.
Key features
- 01Creates a PHP helper file
- 02Configures Composer file autoloading
- 03Runs composer dump-autoload
- 04Recommends small, pure helpers
- 05Suggests value objects for domain logic
Use cases
- 01Add shared helper functions to Laravel
- 02Autoload helper files through Composer
- 03Keep utility functions free of hidden state
Install
Copy the command and run it in a terminal.
$
npx skills add https:/ / github.com/ noartem/ skills --skill laravel-custom-helpersAfter installing, type/laravel-custom-helpersin Claude Code to confirm it loaded.
Details
From the project READMECustom 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