Introduction
Introduction
On this page
{note} You're browsing the documentation for an old version of laravel-casters. Consider upgrading your project to v3. Check your version with the following command:
`composer show rawilk/laravel-casters`
Introduction
Casts for Laravel is a collection of custom class casts for Laravel Eloquent Models. This package allows you to quickly and easily add casts for encrypting attributes and hashing passwords on your user models.
protected $casts = [
// Hashes the value when assigning to `$model->password`.
'password' => Password::class,
// Encrypts on write, decrypts on read.
'classified' => Encrypted::class,
// Encrypts on write, decrypts and typecasts to integer on read.
'secret_number' => Encrypted::class . ':integer',
// Provides utilities for manipulating a name
'name' => Name::class,
];
Alternatives
Some alternatives to this package include:
Disclaimer
This package is not affiliated with, maintained, authorized, endorsed or sponsored by Laravel or any of its affiliates.