devtical / laravel-helpers
Helper Generator for Laravel
Fund package maintenance!
Kristories
Requires
- php: ^8.3
- illuminate/contracts: 12.*
Requires (Dev)
- laravel/pint: ^1.0
- pestphp/pest: ^4.0
README
Helper Generator for Laravel
Installation
Install via composer
composer require devtical/laravel-helpers
Optional
Publish the config by running the php artisan vendor:publish
command.
Configure your helper directory:
# In your .env file
HELPER_DIRECTORY=Helpers
Usage
Create your first helper file:
php artisan make:helper <NAME>
Add your helper functions:
<?php if (!function_exists('str_slug')) { function str_slug($text, $separator = '-') { return Str::slug($text, $separator); } }
Use your helper functions anywhere:
// In your controllers, models, views, etc. $slug = str_slug('Hello World'); // Returns: hello-world
Please see the changelog for more information on what has changed recently.
Testing
$ composer test
Contributing
Please see CONTRIBUTING.md for details.
Security
If you discover any security related issues, please email author instead of using the issue tracker.
Credits
License
This package is open-sourced software licensed under the MIT license.
Support
If you have any questions or need help, please open an issue on GitHub.