Total Complexity | 3 |
Total Lines | 36 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
9 | abstract class AbstractRequest extends FormRequest |
||
10 | { |
||
11 | /** |
||
12 | * {@inheritDoc} |
||
13 | */ |
||
14 | public static function getAttributes() |
||
15 | { |
||
16 | return [ |
||
17 | 'branch_id' => trans('admin-lang.branch'), |
||
18 | 'schedule_date' => trans('Schedule Date'), |
||
19 | 'order_status.note' => trans('Note'), |
||
20 | ]; |
||
21 | } |
||
22 | |||
23 | /** |
||
24 | * Return branch model instance from the request. |
||
25 | * |
||
26 | * @param string $key |
||
27 | * @return \App\Models\Branch |
||
28 | * |
||
29 | * @throws \Illuminate\Database\Eloquent\ModelNotFoundException |
||
30 | */ |
||
31 | public function getBranchFromRequest(string $key = 'branch_id'): Branch |
||
34 | } |
||
35 | |||
36 | /** |
||
37 | * Return "schedule_date" value from the request. |
||
38 | * |
||
39 | * @param string $key |
||
40 | * @return \Illuminate\Support\Carbon |
||
41 | */ |
||
42 | public function getScheduleDate(string $key = 'schedule_date'): Carbon |
||
47 |