spatie/laravel-personal-data-export

Dispatch won't work

Jelle0637 opened this issue · 1 comments

Argument 1 passed to Spatie\PersonalDataExport\Jobs\CreatePersonalDataExportJob::__construct() must be an instance of Spatie\PersonalDataExport\ExportsPersonalData, instance of App\User given, called in /app/Http/Controllers/ExportController.php on line 17

I'm dispatching it as follow:
dispatch(new CreatePersonalDataExportJob(auth()->user()));

You need to implement the ExportsPersonalData interface on your User model as per
https://github.com/spatie/laravel-personal-data-export#selecting-personal-data