search functionality and settings fixes

This commit is contained in:
Chris
2018-02-05 14:21:54 +00:00
parent ae3d27aca8
commit ba273ffbcf
13 changed files with 314 additions and 39 deletions

View File

@@ -32,6 +32,8 @@ class SettingsController extends Controller
{
$setting = Setting::find($id);
if((bool)$setting->system === true) return abort(404);
if (!is_null($setting)) {
return view('settings.edit')->with([
'setting' => $setting,
@@ -80,4 +82,21 @@ class SettingsController extends Controller
]);
}
}
/**
* @param int $id
*
* @return \Illuminate\Http\RedirectResponse
*/
public function clear($id)
{
$setting = Setting::find($id);
if((bool)$setting->system !== true) {
$setting->value = '';
$setting->save();
}
return redirect()->route('settings.index')->with([
'success' => 'You have successfully edited this Setting!',
]);
}
}