PHPackages                             dev-toolbelt/laravel-eloquent-plus - 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. [Database &amp; ORM](/categories/database)
4. /
5. dev-toolbelt/laravel-eloquent-plus

ActiveLibrary[Database &amp; ORM](/categories/database)

dev-toolbelt/laravel-eloquent-plus
==================================

Supercharge your Laravel Eloquent models with automatic validation, audit trails, external IDs, smart casting, and lifecycle hooks — all with zero boilerplate.

1.3.2(1mo ago)2187MITPHPPHP ^8.3CI passing

Since Feb 4Pushed 1mo agoCompare

[ Source](https://github.com/Dev-Toolbelt/laravel-eloquent-plus)[ Packagist](https://packagist.org/packages/dev-toolbelt/laravel-eloquent-plus)[ Docs](https://github.com/Dev-Toolbelt/laravel-eloquent-plus)[ GitHub Sponsors](https://github.com/sponsors/dersonsena)[ RSS](/packages/dev-toolbelt-laravel-eloquent-plus/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (14)Versions (21)Used By (0)

Laravel Eloquent Plus
=====================

[](#laravel-eloquent-plus)

[![CI](https://github.com/Dev-Toolbelt/laravel-eloquent-plus/actions/workflows/ci.yml/badge.svg)](https://github.com/Dev-Toolbelt/laravel-eloquent-plus/actions/workflows/ci.yml)[![codecov](https://camo.githubusercontent.com/ab3bcac4e42dbd3019da38e5a909e5144ebced3c1a4e0c25d2eed8f99620ee12/68747470733a2f2f636f6465636f762e696f2f67682f4465762d546f6f6c62656c742f6c61726176656c2d656c6f7175656e742d706c75732f6272616e63682f6d61696e2f67726170682f62616467652e737667)](https://codecov.io/gh/Dev-Toolbelt/laravel-eloquent-plus)[![Latest Stable Version](https://camo.githubusercontent.com/f17557a0fe683a9349944bccf2102a00bece512a5b4343fe3f855d3a19865b91/68747470733a2f2f706f7365722e707567782e6f72672f6465762d746f6f6c62656c742f6c61726176656c2d656c6f7175656e742d706c75732f762f737461626c65)](https://packagist.org/packages/dev-toolbelt/laravel-eloquent-plus)[![Total Downloads](https://camo.githubusercontent.com/f885faa4ed8d1ba2e5810c9fea9ae078dcee8b8c37a03ef47a4acd355ae89602/68747470733a2f2f706f7365722e707567782e6f72672f6465762d746f6f6c62656c742f6c61726176656c2d656c6f7175656e742d706c75732f646f776e6c6f616473)](https://packagist.org/packages/dev-toolbelt/laravel-eloquent-plus)[![License](https://camo.githubusercontent.com/40713c96d32853fec28a42ee3966058e397db45ffc22b3d95d303a9b7f5b74a2/68747470733a2f2f706f7365722e707567782e6f72672f6465762d746f6f6c62656c742f6c61726176656c2d656c6f7175656e742d706c75732f6c6963656e7365)](https://packagist.org/packages/dev-toolbelt/laravel-eloquent-plus)[![PHP Version](https://camo.githubusercontent.com/ef0054230522e542bc1f908ac005c6c75888dea255bac910f9015e12095e31d7/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253545382e332d626c7565)](https://php.net)

**Supercharge your Laravel Eloquent models** with automatic validation, audit trails, external IDs, smart casting, and lifecycle hooks — all with zero boilerplate.

---

Features
--------

[](#features)

FeatureDescription**Automatic Validation**Validate model attributes before save using Laravel's validation rules**Audit Trail (Blamable)**Automatically track `created_by`, `updated_by`, and `deleted_by`**External ID (UUID)**Public-facing UUIDs while keeping internal integer IDs**Smart Auto-Casting**Infer attribute casts from validation rules automatically**Date Formatting**Control date output format (string or Carbon instance)**Lifecycle Hooks**Execute custom logic at `beforeValidate`, `beforeSave`, `afterSave`, `beforeDelete`, `afterDelete`**Hidden Attributes**Automatically hide sensitive fields like `deleted_at`, `deleted_by`**Custom Validators**Built-in CPF/CNPJ (Brazilian documents) and Hex Color validators**Custom Casts**`OnlyNumbers`, `RemoveSpecialCharacters`, `UuidToIdCast`**Cast Aliases**Register short names for custom casts like Laravel's built-in types---

Requirements
------------

[](#requirements)

- PHP ^8.3
- Laravel ^11.0

---

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

[](#installation)

```
composer require dev-toolbelt/laravel-eloquent-plus
```

The service provider is automatically registered via Laravel's package discovery.

---

Quick Start
-----------

[](#quick-start)

Extend your models from `ModelBase` to unlock all features:

```
