PHP code example of renoki-co / laravel-useful-casts
1. Go to this page and download the library: Download renoki-co/laravel-useful-casts library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
renoki-co / laravel-useful-casts example snippets
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']);