Created
August 30, 2022 01:55
-
-
Save tderick/15a0790c9a5efaae0e17c75e3ddc0fe8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Controllers; | |
use Illuminate\Http\Request; | |
use App\Models\Parameters; | |
class ParametersController extends Controller | |
{ | |
public function index() | |
{ | |
$parameters = Parameters::where('id', 1)->first(); | |
return view('parameters', compact('parameters')); | |
} | |
public function save_parameter(Request $request) | |
{ | |
if (isset($request->all()['email-notification'])) { | |
$data['is_email_notification_actived'] = 1; | |
Parameters::where('id', 1)->update($data); | |
} else { | |
$data['is_email_notification_actived'] = 0; | |
Parameters::where('id', 1)->update($data); | |
} | |
return redirect("/admin/settings")->with("status", "Your parameters have been saved");; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment