added pointer interfaces for jobs
This commit is contained in:
@ -3,32 +3,16 @@
|
||||
namespace App\Jobs\Auth;
|
||||
|
||||
use App\Abstracts\Job;
|
||||
use App\Interfaces\Job\ShouldDelete;
|
||||
|
||||
class DeleteRole extends Job
|
||||
class DeleteRole extends Job implements ShouldDelete
|
||||
{
|
||||
protected $role;
|
||||
|
||||
/**
|
||||
* Create a new job instance.
|
||||
*
|
||||
* @param $role
|
||||
*/
|
||||
public function __construct($role)
|
||||
{
|
||||
$this->role = $role;
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the job.
|
||||
*
|
||||
* @return boolean|Exception
|
||||
*/
|
||||
public function handle()
|
||||
public function handle(): bool
|
||||
{
|
||||
\DB::transaction(function () {
|
||||
$this->role->delete();
|
||||
$this->model->delete();
|
||||
|
||||
$this->role->flushCache();
|
||||
$this->model->flushCache();
|
||||
});
|
||||
|
||||
return true;
|
||||
|
Reference in New Issue
Block a user