Skip to content

Commit

Permalink
Deprecate password cast
Browse files Browse the repository at this point in the history
  • Loading branch information
rawilk committed May 11, 2023
1 parent 31cb0b9 commit da3f063
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/usage/password.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 3 additions & 0 deletions src/Casts/Password.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit da3f063

Please sign in to comment.