The trait Illuminate\Queue\InteractsWithQueue requires some properties which are not provided by App\Jobs\PurgeDeletedAccounts: $failedWith, $releaseDelay
The trait Illuminate\Queue\SerializesModels requires some properties which are not provided by App\Jobs\PurgeDeletedAccounts: $collectionClass, $id, $relations, $class, $keyBy
Loading history...
15
16
/**
17
* Create a new job instance.
18
*
19
* @return void
20
*/
21
public function __construct()
22
{
23
//
24
}
25
26
/**
27
* Execute the job.
28
*
29
* Find users that were soft-deleted 6 months ago and permanently delete them.
30
*/
31
public function handle(): void
32
{
33
// Find users that were soft-deleted 6 months ago
34
User::onlyTrashed()
35
->where('deleted_at', '<', now()->subMonths(6))
36
->get()
37
->each(function ($user) {
38
$user->forceDelete(); // Permanently delete the user