PHPackages                             jonob/radiant - 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. jonob/radiant

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

jonob/radiant
=============

Adds extra functionality to Laravel 4's Eloquent ORM

v1.1.1(13y ago)77742PHPPHP &gt;=5.3.0

Since Jan 13Pushed 12y ago1 watchersCompare

[ Source](https://github.com/JonoB/radiant)[ Packagist](https://packagist.org/packages/jonob/radiant)[ RSS](/packages/jonob-radiant/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependenciesVersions (7)Used By (0)

Radiant
=======

[](#radiant)

Self validating models for Laravel's Eloquent Orm

**Note:** This package is heavily influenced by the Aware bundle for Laravel 3.

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

[](#installation)

### Composer

[](#composer)

Add `"jonob/radiant": "dev-master"` to the `require` section of your `composer.json`:

```
"require": {
	"jonob/radiant": "dev-master"
},

```

Now run `composer update`.

### Laravel

[](#laravel)

Add the following code to the `aliases` section of the `app/config/app.php` file

```
'Radiant' => 'Jonob\Radiant\Radiant',
```

so that it looks something like the following:

```
'aliases' => array(
	...
	'Radiant'       => 'Jonob\Radiant\Radiant',
	...
),
```

Guide
-----

[](#guide)

- [Basic](#basic)
- [Validation](#validation)
- [Retrieving Errors](#errors)
- [Messages](#messages)
- [Save callbacks](#save)

Basic
-----

[](#basic)

Radiant extends the Eloquent model.

To create a new Radiant model, instead of extending the Eloquent class, simply extend the Radiant class:

`class User extends Radiant {}`

Validation
----------

[](#validation)

Radiant models use Laravel's built-in Validation. Defining validation rules for a model is simple:

```
class User extends Radiant {

  /**
   * Radiant validation rules
   */
  protected $rules = array(
    'name' => 'required',
    'email' => 'required|email'
  );
}
```

Radiant models validate themselves automatically when `Radiant->save()` is called.

```
$user = new User();
$user->name = 'John';
$user->email = 'john@doe.com';
$user->save(); // returns false if model is invalid
```

**note:** You also can validate a model at any time using the `Radiant->valid()` method.

Retrieving Errors
-----------------

[](#retrieving-errors)

When a Radiant model fails validation, an Illuminate\\Messages object is attached to the Radiant object.

Retrieve all errors with `$user->getErrors()`.

Validation Messages
-------------------

[](#validation-messages)

You can also set custom error messages in the model if you wish.

```
protected $messages = array(
	'user.required' => 'Please complete the User field.',
);
```

Callbacks
---------

[](#callbacks)

Note the callbacks have been completely removed from Radiant. This is because Laravel's Events are far more flexible and powerful. I highly recommend that you hook into the saving, saved, creating, created, updating, updated, deleting and deleted events as needed.

In fact, Radiant now uses the saving event to run the validator prior to the model being saved.

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 92.3% 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 ~26 days

Recently: every ~32 days

Total

6

Last Release

4765d ago

### Community

Maintainers

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

---

Top Contributors

[![JonoB](https://avatars.githubusercontent.com/u/627725?v=4)](https://github.com/JonoB "JonoB (12 commits)")[![tobz-nz](https://avatars.githubusercontent.com/u/443054?v=4)](https://github.com/tobz-nz "tobz-nz (1 commits)")

---

Tags

laraveleloquent

### Embed Badge

![Health badge](/badges/jonob-radiant/health.svg)

```
[![Health](https://phpackages.com/badges/jonob-radiant/health.svg)](https://phpackages.com/packages/jonob-radiant)
```

###  Alternatives

[rtconner/laravel-likeable

Trait for Laravel Eloquent models to allow easy implementation of a 'like' or 'favorite' or 'remember' feature.

392393.3k5](/packages/rtconner-laravel-likeable)[shiftonelabs/laravel-cascade-deletes

Adds application level cascading deletes to Eloquent Models.

164703.1k2](/packages/shiftonelabs-laravel-cascade-deletes)[highsolutions/eloquent-sequence

A Laravel package for easy creation and management sequence support for Eloquent models with elastic configuration.

121134.8k](/packages/highsolutions-eloquent-sequence)[cybercog/laravel-nova-ban

A Laravel Nova banning functionality for your application.

40203.4k](/packages/cybercog-laravel-nova-ban)[phaza/single-table-inheritance

Single Table Inheritance Trait

1515.8k](/packages/phaza-single-table-inheritance)

PHPackages © 2026

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