Helper Generator for Laravel
Install via composer
composer require devtical/laravel-helpers
Publish the config by running the php artisan vendor:publish
command.
Configure your helper directory:
# In your .env file
HELPER_DIRECTORY=Helpers
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.
$ composer test
Please see CONTRIBUTING.md for details.
If you discover any security related issues, please email author instead of using the issue tracker.
This package is open-sourced software licensed under the MIT license.
If you have any questions or need help, please open an issue on GitHub.