Download the PHP package luilliarcec/laravel-utilities without Composer
On this page you can find all versions of the php package luilliarcec/laravel-utilities. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download luilliarcec/laravel-utilities
More information about luilliarcec/laravel-utilities
Files in luilliarcec/laravel-utilities
Package laravel-utilities
Short Description Laravel Utilities it's a package that includes common utilities for projects.
License MIT
Homepage https://github.com/luilliarcec/laravel-utilities
Informations about the package laravel-utilities
Laravel Utilities
Installation
You can install the package via composer:
Now publish the configuration file into your app's config directory, by running the following command:
Table of Contents
- Set Attributes Uppercase
- Belongs To Auth
- Decimals Rule
Set Attributes Uppercase
This section is for when you want to set all, or some of your attributes to uppercase.
Usage
If you want to ignore some attributes of your model, it can be set in the dontApplyCase
property as follows.
If you want to ignore attributes globally, add them in the utilities
config file under
theattributes_ignored_globally
key.
Belongs To Auth
This section is useful when you have tables in your DB model that are related to the authenticated user. By default, the
name 'user_id' is used as the foreign key for the relationship, but you can change it from the utilities
configuration
file in theauth_foreign_id_column
key.
You can use the BelongsTo Auth
Trait.
- This Trait will add a listener for the
creating
event to associate the authenticated user with the model in question when it is being created. - Also add a global scope to retrieve all the records associated with the authenticated user, you can disable this
scope by calling the
withoutAuth
function when building your query. - In addition, a custom rule is available for the
exists
andunique
rules that add thewhere
condition for the authenticated user, for you. It can also concatenate more conditions and other functionalities of the base rulesexists
andunique
.
Using Trait
Using withoutAuth function
Using Rules
Decimals Rule
If you want to check decimal numbers, and the number of decimal places, you can use this rule as follows.
Testing
Releases
Please see Releases for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Credits
- Luis Andrés Arce C.
- All Contributors
License
The MIT License (MIT). Please see License File for more information.