https://github.com/rawilk/laravel-casters
A collection of custom casts for Laravel.
https://github.com/rawilk/laravel-casters
cast encrypter-cast password-cast
Last synced: about 1 year ago
JSON representation
A collection of custom casts for Laravel.
- Host: GitHub
- URL: https://github.com/rawilk/laravel-casters
- Owner: rawilk
- License: mit
- Created: 2020-09-18T13:41:41.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2025-02-25T19:20:11.000Z (over 1 year ago)
- Last Synced: 2025-05-06T21:07:23.764Z (about 1 year ago)
- Topics: cast, encrypter-cast, password-cast
- Language: PHP
- Homepage: https://randallwilk.dev/docs/laravel-casters
- Size: 178 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: .github/CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
- Security: .github/SECURITY.md
Awesome Lists containing this project
README
# Casts for Laravel
[](https://packagist.org/packages/rawilk/laravel-casters)

[](https://packagist.org/packages/rawilk/laravel-casters)
[](https://packagist.org/packages/rawilk/laravel-casters)
[](https://github.com/rawilk/laravel-casters/blob/main/LICENSE.md)

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 names and hashing passwords on your user models.
```php
protected $casts = [
// Hashes the value when assigning to `$model->password`.
// Note: Password cast is now deprecated. Use Laravel's hash cast instead.
'password' => Password::class,
// Provides utilities for manipulating a name
'name' => Name::class,
];
```
## Installation
You can install the package via composer:
```bash
composer require rawilk/laravel-casters
```
## Documentation
For documentation, please refer to: https://randallwilk.dev/docs/laravel-casters
## Testing
```bash
composer test
```
## Changelog
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
## Contributing
Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.
## Security
Please review [my security policy](.github/SECURITY.md) on how to report security vulnerabilities.
## Credits
- [Randall Wilk](https://github.com/rawilk)
- [All Contributors](../../contributors)
## Alternatives
Some alternatives to this package include:
- [crudly/encrypted](https://github.com/Crudly/Encrypted)
- [watson/nameable](https://github.com/dwightwatson/nameable)
## Disclaimer
This package is not affiliated with, maintained, authorized, endorsed or sponsored by Laravel or any of its affiliates.
## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.