| Conditions | 2 |
| Paths | 5 |
| Total Lines | 16 |
| Code Lines | 9 |
| Lines | 16 |
| Ratio | 100 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php namespace Bedard\Shop\Controllers; |
||
| 18 | View Code Duplication | public function create() |
|
| 19 | { |
||
| 20 | try { |
||
| 21 | // create our new inventory |
||
| 22 | $data = input('inventory'); |
||
| 23 | unset($data['id']); |
||
| 24 | $inventory = Inventory::create($data); |
||
| 25 | $inventory->load('values'); |
||
| 26 | |||
| 27 | // return the new option |
||
| 28 | return Response::make($inventory, 200); |
||
| 29 | } catch (Exception $e) { |
||
| 30 | // if anything went wrong, send back the error message |
||
| 31 | return Response::make($e->getMessage(), 500); |
||
| 32 | } |
||
| 33 | } |
||
| 34 | |||
| 54 |