renoki-co/laravel-useful-casts
Composer 安装命令:
composer require renoki-co/laravel-useful-casts
包简介
Laravel Useful Casts is a simple package for Laravel 7.0+ that comes with already-tested and already-written, useful casts for Eloquent models.
README 文档
README
Laravel Useful Casts is a simple package for Laravel 7.0+ that comes with already-tested and already-written, useful casts for Eloquent models.
🤝 Supporting
If you are using one or more Renoki Co. open-source packages in your production apps, in presentation demos, hobby projects, school projects or so, sponsor our work with Github Sponsors. 📦
🚀 Installation
You can install the package via composer:
composer require renoki-co/laravel-useful-casts
🙌 Usage
use RenokiCo\UsefulCasts\Casts\Encrypted; class User extends Model { protected $casts = [ 'ssn' => Encrypted::class, ]; } // 'ssn' value gets encrypted in the database. $user->update(['ssn' => '12345678']);
Available Casts
| Cast class | Purpose |
|---|---|
RenokiCo\UsefulCasts\Casts\Encrypted::class |
Encrypts and decrypts a value from the database |
RenokiCo\UsefulCasts\Casts\Arrayed::class |
Serializes and unserialies an array. If the value is null, returns an empty array. |
RenokiCo\UsefulCasts\Casts\EncryptedArray::class |
Encrypts and decrypts a value from the database, making sure it's always an array, even if the value is set or get as null |
🐛 Testing
vendor/bin/phpunit
🤝 Contributing
Please see CONTRIBUTING for details.
🔒 Security
If you discover any security related issues, please email alex@renoki.org instead of using the issue tracker.
🎉 Credits
统计信息
- 总下载量: 3.58k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 10
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: Apache-2.0
- 更新时间: 2020-10-21