Download the PHP package l0n3ly/laravel-dynamic-helpers without Composer
On this page you can find all versions of the php package l0n3ly/laravel-dynamic-helpers. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download l0n3ly/laravel-dynamic-helpers
More information about l0n3ly/laravel-dynamic-helpers
Files in l0n3ly/laravel-dynamic-helpers
Package laravel-dynamic-helpers
Short Description Laravel Dynamic Helpers is a package that dynamically resolves helper classes and provides an Artisan command to generate custom helpers in your app/Helpers directory, making helper management effortless and fully automated.
License MIT
Informations about the package laravel-dynamic-helpers
Laravel Dynamic Helpers
A powerful Laravel package that provides a dynamic helper management system with an Artisan command generator. Create, organize, and access your custom helper classes effortlessly.
โจ Features
- ๐ Dynamic Helper Resolution - Automatically resolves helper classes on-demand
- ๐ฏ Artisan Command Generator - Create helpers with
php artisan make:helper - ๐ Nested Helper Support - Organize helpers in subdirectories (e.g.,
Store/CreateHelper) - ๐ Singleton Pattern - Efficient instance caching for better performance
- ๐จ Laravel-Style Output - Beautiful command output matching Laravel's conventions
- ๐ Auto-Discovery - Service provider automatically registered
- ๐ก Direct Function Access - Use
moneyHelper()for real global functions with IDE autocomplete - โก Auto-Booted - Functions automatically registered at service provider boot time
๐ Requirements
- PHP >= 8.1
- Laravel >= 11.0 (11, 12, 13)
๐ฆ Installation
Install the package via Composer:
The service provider will be automatically discovered by Laravel.
๐ Quick Start
1. Create a Helper
This creates app/Helpers/MoneyHelper.php:
2. Use Your Helper
The package automatically registers global functions for all your helpers at boot time. You can access them directly:
You can also access helpers through the helpers() function if preferred:
๐ Usage Examples
Basic Helper
Usage:
Nested Helpers
Create organized helper structures:
This creates:
app/Helpers/Store/CreateHelper.phpapp/Helpers/Store/Product/UpdateHelper.php
Access them using flattened camelCase:
In Controllers
In Blade Templates
๐ฏ Advanced Features
Instance Caching
Helpers are automatically cached as singletons:
Callable Helpers
Helpers can be callable:
Usage:
Custom Helper Methods
Add any methods you need:
๐ Command Reference
Create a Helper
Create Nested Helper
Helper Name Normalization
The command automatically normalizes names:
๐งช Testing
Run the test suite:
Or with PHPUnit:
๐ Code Style
This package uses Laravel Pint for code style. Format code:
๐ค Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
๐ License
The MIT License (MIT). Please see the License File for more information.
๐ค Author
Divine Idehen
- Email: [email protected]
๐ Acknowledgments
- Inspired by Laravel's elegant architecture
- Built with the Laravel community in mind
Made with โค๏ธ for the Laravel community