From da3f0639f461e834c4b96ad3623bb50633d873b3 Mon Sep 17 00:00:00 2001 From: Randall Wilk Date: Thu, 11 May 2023 12:47:54 -0500 Subject: [PATCH] Deprecate password cast --- docs/usage/password.md | 2 ++ src/Casts/Password.php | 3 +++ 2 files changed, 5 insertions(+) diff --git a/docs/usage/password.md b/docs/usage/password.md index 2c99317..ef2ff9c 100644 --- a/docs/usage/password.md +++ b/docs/usage/password.md @@ -5,6 +5,8 @@ sort: 2 ## Introduction +> {note} This cast is now deprecated in favor of the `hash` cast added to laravel in v10.10.0. This cast will be removed in v4 of this package. + If you're like me, you find it a chore to always have to hash a password for your user model. With this cast, your passwords will automatically be hashed on your models. This cast only mutates values, so you will still see the hashed version of the password when referencing it on your models. diff --git a/src/Casts/Password.php b/src/Casts/Password.php index d94cb44..baa3e75 100644 --- a/src/Casts/Password.php +++ b/src/Casts/Password.php @@ -7,6 +7,9 @@ use Illuminate\Contracts\Database\Eloquent\CastsInboundAttributes; use Illuminate\Support\Facades\Hash; +/** + * @deprecated Use Laravel's hash cast instead. Will be removed in v4 + */ class Password implements CastsInboundAttributes { public function set($model, string $key, $value, array $attributes)