'like', 'email' => 'like', 'status' => '=' ]; /** * @var string */ protected $table = 'users'; /** * @var array|string[] */ protected array $form = ['username', 'email', 'password']; /** * * @return mixed */ public function getJWTIdentifier(): mixed { return $this->getKey(); } /** * Return a key value array, containing any custom claims to be added to the JWT. * * @return array */ public function getJWTCustomClaims(): array { return []; } /** * password * * @return Attribute */ protected function password(): Attribute { return new Attribute( // get: fn($value) => '', set: fn ($value) => bcrypt($value), ); } /** * update * @param $id * @param array $data * @return mixed */ public function updateBy($id, array $data): mixed { if (isset($data['password']) && ! $data['password']) { unset($data['password']); } return parent::updateBy($id, $data); } }