Total Complexity | 4 |
Total Lines | 27 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
15 | class EquipmentInformationController extends Controller |
||
16 | { |
||
17 | 2 | public function index() |
|
18 | { |
||
19 | 2 | return view('admin.equipment.equipmentInformation', [ |
|
20 | 2 | 'fields' => (new GetEquipDataFields)->getAllFieldsWithStats(), |
|
21 | ]); |
||
22 | } |
||
23 | |||
24 | 2 | public function newField(NewFieldRequest $request) |
|
25 | { |
||
26 | 2 | (new SetEquipmentDataFields)->processNewField($request->name, $request->hidden); |
|
27 | 2 | return response()->json(['success' => true]); |
|
28 | } |
||
29 | |||
30 | 2 | public function submitFieldName(EditFieldRequest $request) |
|
31 | { |
||
32 | 2 | (new SetEquipmentDataFields)->editExistingField($request->data_type_id, $request->name, $request->hidden); |
|
33 | 2 | Log::info('Data Field Type ID '.$request->data_type_id.' was updated by '.Auth::user()->full_name.'. Data - ', $request->toArray()); |
|
34 | 2 | return response()->json(['success' => true]); |
|
35 | } |
||
36 | |||
37 | 2 | public function deleteField($id) |
|
42 | } |
||
43 | } |
||
44 |