Skip to content

Commit da3f063

Browse files
committed
Deprecate password cast
1 parent 31cb0b9 commit da3f063

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

docs/usage/password.md

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ sort: 2
55

66
## Introduction
77

8+
> {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.
9+
810
If you're like me, you find it a chore to always have to hash a password for your user model. With this cast,
911
your passwords will automatically be hashed on your models. This cast only mutates values, so you will still
1012
see the hashed version of the password when referencing it on your models.

src/Casts/Password.php

+3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
use Illuminate\Contracts\Database\Eloquent\CastsInboundAttributes;
88
use Illuminate\Support\Facades\Hash;
99

10+
/**
11+
* @deprecated Use Laravel's hash cast instead. Will be removed in v4
12+
*/
1013
class Password implements CastsInboundAttributes
1114
{
1215
public function set($model, string $key, $value, array $attributes)

0 commit comments

Comments
 (0)