Error when User::factory()->create() on ModelObserver::saving($model) : model must be of type CipherSweetEncrypted, User given #34
Unanswered
petergithubmgw
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Got the same error, you need to add |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Ciphersweet working okay creating users and login, but I can't test as User::factory()->create() throws next error:
Spatie\LaravelCipherSweet\Observers\ModelObserver::saving(): Argument #1 ($model) must be of type Spatie\LaravelCipherSweet\Contracts\CipherSweetEncrypted, App\Models\User given, called in ...\vendor\laravel\framework\src\Illuminate\Events\Dispatcher.php on line 441
I've tried adding use UsesCipherSweet; at UserFactory class (I've added configureCipherSweet function too), but it keeps failing.
What I'm missing? Thanks.
Beta Was this translation helpful? Give feedback.
All reactions