| Conditions | 1 |
| Paths | 1 |
| Total Lines | 19 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 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 | } |
||
| 63 |