You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I get this error: 'Spatie\PersonalDataExport\Exceptions\InvalidUser
Could not create a personal data download for App\Models\User because it does have an email property.' when I call the create personal data export job. My user model already implements the ExportsPersonalData trait and I called the dispatch job like this: return dispatch(new CreatePersonalDataExportJob($user)); I get the same error with a controller or a closure.
This is my closure: Route::middleware(['auth:sanctum', 'verified'])->post('/user/export-personal-data', function (User $user) {
return dispatch(new CreatePersonalDataExportJob($user));
})->name('user.export-personal-data');
When I use: return dispatch(new CreatePersonalDataExportJob(auth()->user())); I get 'Expected type 'Spatie\PersonalDataExport\ExportsPersonalData'. Found 'Illuminate\Contracts\Auth\Authenticable|null', and a different error message.
Interestingly, when I call: return dispatch(new CreatePersonalDataExportJob($user)); in an existing Jetstream DeleteUser class, I get the email with the zip file and in storage.
This discussion was converted from issue #66 on February 13, 2022 15:20.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi, I get this error: 'Spatie\PersonalDataExport\Exceptions\InvalidUser
Could not create a personal data download for
App\Models\User
because it does have an email property.' when I call the create personal data export job. My user model already implements the ExportsPersonalData trait and I called the dispatch job like this: return dispatch(new CreatePersonalDataExportJob($user)); I get the same error with a controller or a closure.This is my closure: Route::middleware(['auth:sanctum', 'verified'])->post('/user/export-personal-data', function (User $user) {
return dispatch(new CreatePersonalDataExportJob($user));
})->name('user.export-personal-data');
When I use: return dispatch(new CreatePersonalDataExportJob(auth()->user())); I get 'Expected type 'Spatie\PersonalDataExport\ExportsPersonalData'. Found 'Illuminate\Contracts\Auth\Authenticable|null', and a different error message.
Interestingly, when I call: return dispatch(new CreatePersonalDataExportJob($user)); in an existing Jetstream DeleteUser class, I get the email with the zip file and in storage.
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions