*/ use HasFactory; use HasProfilePhoto; use Notifiable; use TwoFactorAuthenticatable; /** * 發送密碼重設通知 * * @param string $token * @return void */ public function sendPasswordResetNotification( $token ) { $this->notify( new CustomResetPasswordNotification( $token ) ); } /** * The attributes that are mass assignable. * * @var array */ protected $fillable = [ 'name', 'email', 'password', 'school_no', 'valid_date', ]; /** * The attributes that should be hidden for serialization. * * @var array */ protected $hidden = [ 'password', 'remember_token', 'two_factor_recovery_codes', 'two_factor_secret', ]; /** * The accessors to append to the model's array form. * * @var array */ protected $appends = [ 'profile_photo_url', ]; /** * Get the attributes that should be cast. * * @return array */ protected function casts(): array { return [ 'email_verified_at' => 'datetime', // 'email' => 'hashed', // encrypted email // 'email' => 'encrypted', 'password' => 'hashed', ]; } /** * 自動解密 email */ // public function getEmailAttribute($value) { // return Crypt::decryptString($value); // } /** * 自動加密 email */ // public function setEmailAttribute($value) { // $this->attributes['email'] = Crypt::encryptString($value); // } }