whoami7 - Manager
:
/
home
/
qbizpnmr
/
test.qbiztax.com
/
app
/
Jobs
/
Auth
/
Upload File:
files >> //home/qbizpnmr/test.qbiztax.com/app/Jobs/Auth/DeleteUser.php
<?php namespace App\Jobs\Auth; use App\Abstracts\Job; use App\Events\Auth\UserDeleted; use App\Events\Auth\UserDeleting; use App\Interfaces\Job\ShouldDelete; class DeleteUser extends Job implements ShouldDelete { public function handle(): bool { $this->authorize(); event(new UserDeleting($this->model)); \DB::transaction(function () { $this->deleteRelationships($this->model, ['invitation']); $this->model->delete(); $this->model->flushCache(); }); event(new UserDeleted($this->model)); return true; } /** * Determine if this action is applicable. */ public function authorize(): void { // Can't delete yourself if ($this->model->id == user()->id) { $message = trans('auth.error.self_delete'); throw new \Exception($message); } } }
Copyright ©2021 || Defacer Indonesia