Utilities for Laravel applications, including various helpful features such as zip file creation, enum handling, and more.
hyder/laravel-utils is a Laravel package for utilities for laravel applications, including various helpful features such as zip file creation, enum handling, and more..
It currently has 0 GitHub stars and 8 downloads on Packagist (latest version 0.0.1).
Install it with composer require hyder/laravel-utils.
Discover more Laravel packages by hyder
or browse all Laravel packages to compare alternatives.
Last updated
Utilities for Laravel applications, including various helpful features such as zip file creation, enum handling, and more.
You can install the package via Composer:
composer require hyder/laravel-utils
After installing the package, you can publish the configuration file using Artisan:
php artisan vendor:publish --tag=laravel-utils-config
This will publish the configuration file laravel-utils.php to your config directory.
The configuration file allows you to customize the behavior of the package:
// config/laravel-utils.php
return [
'enums' => [
// Directory path where enum classes are located
'dir_path' => app_path('Enums'),
// Namespace for enum classes
'namespace' => 'App\Enums',
],
];
You can adjust the dir_path and namespace values to match your application's structure.
The Enum facade allows you to work with enums in your Laravel application.
You can list all available enums using the list method:
$enums = Enum::list();
This will return an array containing the constants of all enums.
You can set the directory and namespace for enums using the setDirectory and setNamespace methods, respectively before calling list method.
use Hyder\LaravelUtils\Facades\Enum;
Enum::setDirectory('path/to/enums')
->setNamespace('App\Enums')
->list();
Laravel Utils is open-source software licensed under the MIT license.