datalogix / laravel-utils
Laravel Utils is a package that configure simple things, which we usually forget about in our projects.
v4.3.0
2024-12-13 14:10 UTC
Requires
- php: ^7.4|^8.0
- datalogix/laravel-translation: ^1.1|^2.0
- datalogix/laravel-validation: ^1.3|^2.0
- illuminate/contracts: ^8.0|^9.0|^10.0|^11.0
- illuminate/database: ^8.0|^9.0|^10.0|^11.0
- illuminate/pagination: ^8.0|^9.0|^10.0|^11.0
- illuminate/support: ^8.0|^9.0|^10.0|^11.0
Requires (Dev)
- graham-campbell/testbench: ^6.1
- phpunit/phpunit: ^9.5|^10.5
- dev-main
- v4.3.0
- v4.2.0
- v4.1.0
- v4.0.0
- v3.20.0
- v3.19.0
- v3.18.0
- v3.17.0
- v3.16.0
- v3.15.0
- v3.14.0
- v3.13.0
- v3.12.0
- v3.11.0
- v3.10.0
- v3.9.0
- v3.8.0
- v3.7.0
- v3.6.0
- v3.5.0
- v3.4.0
- v3.3.0
- v3.2.0
- v3.1.0
- v3.0.3
- v3.0.2
- v3.0.1
- v3.0.0
- v2.2.0
- v2.1.0
- v2.0.0
- v1.3.0
- v1.2.0
- v1.1.1
- v1.1.0
- v1.0.1
- v1.0.0
- dev-feat-model-strict
- dev-feat-vite-strategy
This package is auto-updated.
Last update: 2024-12-13 14:15:56 UTC
README
Laravel Utils is a package that configure simple things, which we usually forget about in our projects.
Features
- Translations
EN
andpt_BR
- Model unguarded
disabled
- Set locale
LC_ALL
when updated - Set default string length for schema to
150
- Middleware to force https on
production environment
- Set default view for paginator to
tailwind
- Register translations automatically using datalogix/laravel-translation.
- Inject Respect Validation using datalogix/laravel-validation.
Installation
You can install the package via composer:
composer require datalogix/laravel-utils
The package will automatically register itself.
Translations
To publish Portuguese translations (pt_BR), use the command below:
php artisan vendor:publish --provider="Datalogix\Utils\UtilsServiceProvider" --tag="lang"
Configuration
The defaults are set in config/utils.php
. Copy this file to your own config directory to modify the values. You can publish the config using this command:
php artisan vendor:publish --provider="Datalogix\Utils\UtilsServiceProvider" --tag="config"
This is the contents of the published file:
/* |-------------------------------------------------------------------------- | Laravel Utils |-------------------------------------------------------------------------- */ return [ 'model' => [ 'unguard' => env('UTILS_MODEL_UNGUARD', false), ], 'locale' => [ 'category' => env('UTILS_LOCALE_CATEGORY', LC_ALL), ], 'schema' => [ 'defaultStringLength' => env('UTILS_SCHEMA_STRING_LENGTH', 150), ], 'https' => [ 'forceScheme' => env('UTILS_HTTPS_FORCE_SCHEME', app()->environment('production')), 'middleware' => env('UTILS_HTTPS_MIDDLEWARE', app()->environment('production')), ], 'paginator' => [ 'defaultView' => env('UTILS_PAGINATOR_VIEW', 'pagination::tailwind'), 'defaultSimpleView' => env('UTILS_PAGINATOR_SIMPLE_VIEW', 'pagination::simple-tailwind'), ], ];