akaunting/app/Jobs/Auth/CreatePermission.php

20 lines
393 B
PHP
Raw Normal View History

2019-11-16 10:21:14 +03:00
<?php
namespace App\Jobs\Auth;
use App\Abstracts\Job;
2021-09-06 11:53:57 +03:00
use App\Interfaces\Job\ShouldCreate;
2019-11-16 10:21:14 +03:00
use App\Models\Auth\Permission;
2021-09-06 11:53:57 +03:00
class CreatePermission extends Job implements ShouldCreate
2019-11-16 10:21:14 +03:00
{
2021-09-06 11:53:57 +03:00
public function handle(): Permission
2019-11-16 10:21:14 +03:00
{
2020-06-26 13:40:19 +03:00
\DB::transaction(function () {
2021-09-06 11:53:57 +03:00
$this->model = Permission::create($this->request->all());
2020-06-26 13:40:19 +03:00
});
2019-11-16 10:21:14 +03:00
2021-09-06 11:53:57 +03:00
return $this->model;
2019-11-16 10:21:14 +03:00
}
}