Total Complexity | 5 |
Total Lines | 46 |
Duplicated Lines | 0 % |
Changes | 3 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
9 | class GuestService extends CRUDServices |
||
10 | { |
||
11 | protected Guest $guest; |
||
12 | |||
13 | public function __construct() |
||
14 | { |
||
15 | $this->guest = app(Guest::class); |
||
16 | |||
17 | $guestId = request()->route('guest') ?? request('guest_id'); |
||
18 | |||
19 | if ($guestId) { |
||
20 | $this->guest = $this->guest->resolveRouteBinding($guestId); |
||
21 | } |
||
22 | } |
||
23 | |||
24 | /** |
||
25 | * Retrieves an instance of guest. |
||
26 | * |
||
27 | * @return \Innoflash\Events\Models\Guest |
||
28 | */ |
||
29 | public function getGuest(): Guest |
||
30 | { |
||
31 | return $this->guest; |
||
32 | } |
||
33 | |||
34 | /** |
||
35 | * Makes a list of fields that you do not want to be sent |
||
36 | * to the create or update methods. |
||
37 | * Its mainly the fields that you do not have in the messages table. |
||
38 | * |
||
39 | * @return array |
||
40 | */ |
||
41 | public function getUnsetFields(): array |
||
44 | } |
||
45 | |||
46 | /** |
||
47 | * Attaches a parent to the current guest |
||
48 | * You can delete this if you do not intent to create guests from parent relationships. |
||
49 | */ |
||
50 | public function getParentRelationship() |
||
55 | ]; |
||
56 | } |
||
57 | } |
||
58 |