Changeset View
Changeset View
Standalone View
Standalone View
src/app/Jobs/UserDelete.php
- This file was copied to src/app/Jobs/DomainDelete.php.
<?php | <?php | ||||
namespace App\Jobs; | namespace App\Jobs; | ||||
use App\Backends\LDAP; | |||||
use App\User; | |||||
use Illuminate\Bus\Queueable; | use Illuminate\Bus\Queueable; | ||||
use Illuminate\Queue\SerializesModels; | use Illuminate\Queue\SerializesModels; | ||||
use Illuminate\Queue\InteractsWithQueue; | use Illuminate\Queue\InteractsWithQueue; | ||||
use Illuminate\Contracts\Queue\ShouldQueue; | use Illuminate\Contracts\Queue\ShouldQueue; | ||||
use Illuminate\Foundation\Bus\Dispatchable; | use Illuminate\Foundation\Bus\Dispatchable; | ||||
class UserDelete implements ShouldQueue | class UserDelete implements ShouldQueue | ||||
{ | { | ||||
use Dispatchable; | use Dispatchable; | ||||
use InteractsWithQueue; | use InteractsWithQueue; | ||||
use Queueable; | use Queueable; | ||||
use SerializesModels; | use SerializesModels; | ||||
protected $user; | protected $user; | ||||
public $tries = 5; | public $tries = 5; | ||||
/** @var bool Delete the job if its models no longer exist. */ | /** @var bool Delete the job if its models no longer exist. */ | ||||
public $deleteWhenMissingModels = true; | public $deleteWhenMissingModels = true; | ||||
/** | /** | ||||
* Create a new job instance. | * Create a new job instance. | ||||
* | * | ||||
* @param \App\User $user The user to delete. | * @param int $user_id The ID of the user to delete. | ||||
* | * | ||||
* @return void | * @return void | ||||
*/ | */ | ||||
public function __construct(\App\User $user) | public function __construct(int $user_id) | ||||
{ | { | ||||
$this->user = $user; | $this->user = User::withTrashed()->find($user_id); | ||||
} | } | ||||
/** | /** | ||||
* Execute the job. | * Execute the job. | ||||
* | * | ||||
* @return void | * @return void | ||||
*/ | */ | ||||
public function handle() | public function handle() | ||||
{ | { | ||||
// | LDAP::deleteUser($this->user); | ||||
} | } | ||||
} | } |