PHPackages                             luilliarcec/laravel-utilities - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. luilliarcec/laravel-utilities

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

luilliarcec/laravel-utilities
=============================

Laravel Utilities it's a package that includes common utilities for projects.

3.1.0(2y ago)2267MITPHPPHP &gt;=8.0

Since Feb 8Pushed 2y ago1 watchersCompare

[ Source](https://github.com/luilliarcec/laravel-utilities)[ Packagist](https://packagist.org/packages/luilliarcec/laravel-utilities)[ Docs](https://github.com/luilliarcec/laravel-utilities)[ RSS](/packages/luilliarcec-laravel-utilities/feed)WikiDiscussions 3.x Synced 2w ago

READMEChangelog (7)Dependencies (4)Versions (15)Used By (0)

Laravel Utilities
=================

[](#laravel-utilities)

[![run-tests](https://github.com/luilliarcec/laravel-utilities/workflows/run-tests/badge.svg)](https://github.com/luilliarcec/laravel-utilities/workflows/run-tests/badge.svg)[![Latest Version on Packagist](https://camo.githubusercontent.com/7182a926afafd4e5f9c1050714973b96f551815b93b1de47664825b7a66783a0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c75696c6c6961726365632f6c61726176656c2d7574696c69746965732e737667)](https://packagist.org/packages/luilliarcec/laravel-utilities)[![Total Downloads](https://camo.githubusercontent.com/3709f2ec9651cf37ae69c4591a7b6cc2607a0c9564c124bd6f751a97932d7562/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c75696c6c6961726365632f6c61726176656c2d7574696c6974696573)](https://packagist.org/packages/luilliarcec/laravel-utilities)[![GitHub license](https://camo.githubusercontent.com/ef4554a220d61591838dfa4af2175dbe790a9ff9812be6e45a3b254a2425c3e2/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6c75696c6c6961726365632f6c61726176656c2d7574696c6974696573)](https://github.com/luilliarcec/laravel-utilities/blob/develop/LICENSE.md)

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require luilliarcec/laravel-utilities
```

Now publish the configuration file into your app's config directory, by running the following command:

```
php artisan vendor:publish --provider="Luilliarcec\Utilities\UtilitiesServiceProvider"
```

Table of Contents
-----------------

[](#table-of-contents)

- [Set Attributes Uppercase](#set-attributes-uppercase)
- [Belongs To Auth](#belongs-to-auth)
- [Decimals Rule](#decimals-rule)

Set Attributes Uppercase
------------------------

[](#set-attributes-uppercase)

This section is for when you want to set all, or some of your attributes to uppercase.

#### Usage

[](#usage)

```
// ...
use Luilliarcec\Utilities\Concerns\SetAttributesUppercase;

class User extends Authenticable
{
    use SetAttributesUppercase;
}
```

If you want to ignore some attributes of your model, it can be set in the `dontApplyCase` property as follows.

```
// ...
use Luilliarcec\Utilities\Concerns\SetAttributesUppercase;

class User extends Authenticable
{
    use SetAttributesUppercase;

    protected $dontApplyCase = [
        'username'
    ];
}
```

If you want to ignore attributes globally, add them in the `utilities` config file under the` attributes_ignored_globally` key.

Belongs To Auth
---------------

[](#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 the` auth_foreign_id_column` key.

You can use the `BelongsTo Auth` Trait.

1. 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.
2. 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.
3. In addition, a custom rule is available for the `exists` and` unique` rules that add the `where` condition for the authenticated user, for you. It can also concatenate more conditions and other functionalities of the base rules `exists` and` unique`.

#### Using Trait

[](#using-trait)

```
// ...
use Luilliarcec\Utilities\Concerns\BelongsToAuthenticated;

class Invoice extends Model
{
    use BelongsToAuthenticated;
}
```

#### Using withoutAuth function

[](#using-withoutauth-function)

```
Invoice::withoutAuthenticated()
    // ->where(...)
    ->get();
```

#### Using Rules

[](#using-rules)

```
use Luilliarcec\Utilities\Rules\Authenticated;

Request::validate([
    'invoice_id' => Authenticated::make('invoices', 'id')->exists() // ->where(...)
]);
```

Decimals Rule
-------------

[](#decimals-rule)

If you want to check decimal numbers, and the number of decimal places, you can use this rule as follows.

```
use Luilliarcec\Utilities\Rules\Decimals;

Request::validate([
    'amount' => new Decimals // by default they are 8 integers and 2 decimals
]);

Request::validate([
    'amount' => new Decimals(20, 4) // 20 integers and 4 decimals
]);
```

Testing
-------

[](#testing)

```
composer test
```

Releases
--------

[](#releases)

Please see [Releases](https://github.com/luilliarcec/laravel-utilities/releases) for more information what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Luis Andrés Arce C.](https://github.com/luilliarcec)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~87 days

Recently: every ~75 days

Total

12

Last Release

1034d ago

Major Versions

0.0.1 → 1.0.02021-07-10

1.x-dev → 2.0.02022-09-04

2.x-dev → 3.0.02022-12-20

PHP version history (4 changes)0.0.1PHP ^7.4|^8.0

2.0.0PHP ^8.0

3.0.0PHP ^8.1

3.1.0PHP &gt;=8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/a739133b1773f13548e74e67db0ca26e16676c94269df44e4062da0fb28efc36?d=identicon)[luilliarcec](/maintainers/luilliarcec)

---

Top Contributors

[![luilliarcec](https://avatars.githubusercontent.com/u/27895611?v=4)](https://github.com/luilliarcec "luilliarcec (50 commits)")

---

Tags

laravelutilitiesluilliarcecLaravel Utilities

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/luilliarcec-laravel-utilities/health.svg)

```
[![Health](https://phpackages.com/badges/luilliarcec-laravel-utilities/health.svg)](https://phpackages.com/packages/luilliarcec-laravel-utilities)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
