| Total Complexity | 5 |
| Total Lines | 48 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 13 | class AdminConfigurationFieldController extends Controller |
||
| 14 | { |
||
| 15 | public function setNewConfiguration(Request $r){ |
||
| 16 | |||
| 17 | $r->validate([ |
||
| 18 | 'name' => 'required', |
||
| 19 | 'type' => 'required', |
||
| 20 | 'category' => 'required' |
||
| 21 | ]); |
||
| 22 | |||
| 23 | $name = $r->get('name'); |
||
| 24 | $type = $r->get('type'); |
||
| 25 | $category_id = $r->get('category'); |
||
| 26 | |||
| 27 | $configuration = new ConfigurationField(); |
||
| 28 | $configuration->category_id = $category_id; |
||
| 29 | $configuration->type = $type; |
||
| 30 | $configuration->name = $name; |
||
| 31 | $configuration->save(); |
||
| 32 | |||
| 33 | return response()->json(true); |
||
| 34 | } |
||
| 35 | |||
| 36 | public function getConfigurationFields(Request $r){ |
||
| 48 | |||
| 49 | } |
||
| 50 | |||
| 51 | public function generateConfigurationFieldHtml($field){ |
||
| 61 | } |
||
| 62 | } |
||
| 63 |