Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 3 |
|
0.00% |
0 / 3 |
CRAP | |
0.00% |
0 / 1 |
| UserRoleObserver | |
0.00% |
0 / 3 |
|
0.00% |
0 / 3 |
12 | |
0.00% |
0 / 1 |
| created | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| updated | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| deleted | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace App\Observers; |
| 4 | |
| 5 | use App\Http\Models\Auth\UserRole; |
| 6 | use App\Jobs\ProcessUserRoleAsyncJob; |
| 7 | |
| 8 | class UserRoleObserver |
| 9 | { |
| 10 | public function created(UserRole $userRole): void |
| 11 | { |
| 12 | ProcessUserRoleAsyncJob::dispatch($userRole, 'created'); |
| 13 | } |
| 14 | |
| 15 | public function updated(UserRole $userRole): void |
| 16 | { |
| 17 | ProcessUserRoleAsyncJob::dispatch($userRole, 'updated'); |
| 18 | } |
| 19 | |
| 20 | public function deleted(UserRole $userRole): void |
| 21 | { |
| 22 | ProcessUserRoleAsyncJob::dispatch($userRole, 'deleted'); |
| 23 | } |
| 24 | } |