PHPackages                             andydefer/laravel-utils - 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. andydefer/laravel-utils

ActiveLibrary

andydefer/laravel-utils
=======================

Utility package for Laravel including Transformable proxies and helpers

v0.3.2(today)05↑2900%MITPHPPHP ^8.1

Since Aug 1Pushed todayCompare

[ Source](https://github.com/andydefer/laravel-utils)[ Packagist](https://packagist.org/packages/andydefer/laravel-utils)[ RSS](/packages/andydefer-laravel-utils/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (6)Versions (6)Used By (0)

Laravel Utils
=============

[](#laravel-utils)

Description
-----------

[](#description)

Package d'utilitaires pour Laravel offrant des proxies pour l'hydratation automatique d'objets `Transformable` (Value Objects, Records, DTOs) depuis des sources variées (tableaux, JSON, colonnes de base de données).

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

[](#installation)

```
composer require andydefer/laravel-utils
```

Prérequis
---------

[](#prérequis)

- PHP 8.1 ou supérieur
- Laravel 10.x, 11.x ou 12.x
- `andydefer/domain-structures` ^1.0

Fonctionnalités
---------------

[](#fonctionnalités)

### TransformableProxy

[](#transformableproxy)

Proxy statique pour créer des objets `Transformable` depuis diverses sources :

```
use AndyDefer\LaravelUtils\Proxies\TransformableProxy;
use App\ValueObjects\SlugVO;

// Depuis une chaîne
$slug = TransformableProxy::make(SlugVO::class, 'mon-slug');

// Depuis un tableau
$user = TransformableProxy::make(UserRecord::class, [
    'name' => 'John Doe',
    'email' => 'john@example.com',
]);

// Depuis du JSON
$product = TransformableProxy::make(ProductRecord::class, '{"name":"Laptop","price":999}');

// Avec nullable
$coordinates = TransformableProxy::make(CoordinatesVO::class, null, nullable: true);
```

### AttributeProxy

[](#attributeproxy)

Proxy pour créer des attributs Eloquent qui hydratent automatiquement des objets `Transformable` :

```
use AndyDefer\LaravelUtils\Proxies\AttributeProxy;
use App\ValueObjects\SlugVO;
use App\ValueObjects\CoordinatesVO;
use App\Records\SettingsRecord;

class User extends Model
{
    // Attribut simple
    protected function slug(): Attribute
    {
        return AttributeProxy::make(SlugVO::class);
    }

    // Attribut nullable
    protected function coordinates(): Attribute
    {
        return AttributeProxy::nullable(CoordinatesVO::class);
    }

    // Attribut avec colonne différente
    protected function settings(): Attribute
    {
        return AttributeProxy::make(SettingsRecord::class, column: 'metadata');
    }
}

// Utilisation
$user = User::find(1);
echo $user->slug->value;        // 'john-doe'
echo $user->coordinates->lat;   // 48.8566
echo $user->settings->theme;    // 'dark'
```

Documentation
-------------

[](#documentation)

- [TransformableProxy - Référence Technique](docs/TransformableProxy.md)
- [AttributeProxy - Référence Technique](docs/AttributeProxy.md)

Tests
-----

[](#tests)

```
composer test
```

Contribuer
----------

[](#contribuer)

1. Forker le projet
2. Créer une branche (`git checkout -b feature/ma-fonctionnalite`)
3. Commiter les changements (`git commit -m 'Ajout de ma fonctionnalité'`)
4. Pusher (`git push origin feature/ma-fonctionnalite`)
5. Ouvrir une Pull Request

Licence
-------

[](#licence)

MIT © [Andy Defer](https://github.com/andydefer)

Auteur
------

[](#auteur)

- **Andy Defer** - [GitHub](https://github.com/andydefer)

Dépendances
-----------

[](#dépendances)

- `andydefer/domain-structures` - Interfaces et classes de base pour les objets transformables
- `illuminate/database` - Pour les attributs Eloquent

---

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance100

Actively maintained with recent releases

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

 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 ~0 days

Total

5

Last Release

0d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2170ec3fbad9eb4b002661ab4f58b1cc374eae4293b92904c6a74bc2818bd570?d=identicon)[andydefer](/maintainers/andydefer)

---

Top Contributors

[![andydefer](https://avatars.githubusercontent.com/u/124321745?v=4)](https://github.com/andydefer "andydefer (9 commits)")

###  Code Quality

TestsPHPUnit

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/andydefer-laravel-utils/health.svg)

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

###  Alternatives

[backpack/crud

Quickly build admin interfaces using Laravel, Bootstrap and JavaScript.

3.4k3.8M227](/packages/backpack-crud)[unopim/unopim

UnoPim Laravel PIM

10.8k2.5k](/packages/unopim-unopim)[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

137236.2k8](/packages/statamic-rad-pack-runway)[duncanmcclean/statamic-cargo

Comprehensive e-commerce addon for Statamic. Build bespoke e-commerce sites without the complexity.

3518.3k](/packages/duncanmcclean-statamic-cargo)[ecotone/laravel

Ecotone for Laravel — CQRS, Event Sourcing, Sagas, Durable Workflows, and Outbox on top of Laravel Queue, via PHP attributes.

21327.3k4](/packages/ecotone-laravel)

PHPackages © 2026

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