add support for editing service options

This commit is contained in:
Dane Everitt 2016-02-20 15:59:37 -05:00
parent 4e60adc875
commit e42547a1ff
3 changed files with 116 additions and 23 deletions

View file

@ -107,7 +107,19 @@ class ServiceController extends Controller
public function postOption(Request $request, $option)
{
// editing option
try {
$repo = new ServiceRepository\Option;
$repo->update($option, $request->except([
'_token'
]));
Alert::success('Option settings successfully updated.')->flash();
} catch (DisplayValidationException $ex) {
return redirect()->route('admin.services.option', $option)->withErrors(json_decode($ex->getMessage()))->withInput();
} catch (\Exception $ex) {
Log::error($ex);
Alert::danger('An error occured while attempting to modify this option.')->flash();
}
return redirect()->route('admin.services.option', $option)->withInput();
}
public function postOptionVariable(Request $request, $option, $variable)