true, 'title' => 'Edit Setting', ]); } /** * Show the form for creating a new resource. */ public function create() { // } /** * Store a newly created resource in storage. */ public function store(Request $request) { $request->mergeIfMissing([ 'enable_reCaptcha' => 0, ]); $input = $request->except(['_token', '_method']); foreach ($input as $key => $value) { Setting::updateOrCreate( ['key' => $key], ['value' => $value] ); } Cache::forget('setting'); return to_route('setting.index')->with('success', 'Setting have been updated!'); } /** * Show the specified resource. */ public function show($id) { // } /** * Show the form for editing the specified resource. */ public function edit($id) { // } /** * Update the specified resource in storage. */ public function update(Request $request, $id) { // } /** * Remove the specified resource from storage. */ public function destroy($id) { // } }