Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 10 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
CreateDefaultShortcutCategory | |
0.00% |
0 / 10 |
|
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
handle | |
0.00% |
0 / 10 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | |
3 | namespace App\Listeners\Business; |
4 | |
5 | use App\Events\Business\Registered; |
6 | use App\Http\Models\ShortcutCategory; |
7 | |
8 | class CreateDefaultShortcutCategory |
9 | { |
10 | public function handle(Registered $event): void |
11 | { |
12 | $data = [ |
13 | 'user_id' => $event->user->id, |
14 | 'name' => 'Default Category', |
15 | 'is_default' => true, |
16 | 'seq_id' => 1, |
17 | ]; |
18 | |
19 | ShortcutCategory::updateOrCreate([ |
20 | 'user_id' => $event->user->id, |
21 | 'is_default' => true |
22 | ], $data); |
23 | } |
24 | } |