it-can/laravel-model-traits

This package is abandoned and no longer maintained. No replacement package was suggested.

My custom Laravel 5.3+ model traits

dev-master 2017-07-16 11:23 UTC

This package is auto-updated.

Last update: 2019-02-20 19:26:28 UTC


README

My custom Laravel 5.4+ model traits

MIT License

use at your own risk!

to use add this to composer.json: "it-can/laravel-model-traits": "dev-master"

to use in a Model:

use ITCAN\laravelModelTraits\RandomOrderByTrait; * REMOVED, LARAVEL 5.2+ has now inRandomOrder() function *
use ITCAN\laravelModelTraits\TableNameTrait;
use ITCAN\laravelModelTraits\Encryptable;

then use within the class:

use RandomOrderByTrait; * REMOVED *
use TableNameTrait;
use Encryptable;

To use the Encryptable trait in your model, add an array to your model.

protected $encrypted = [
    'email',
];

The email field will now be encrypted / decrypted...