2021-01-15 14:47:59 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
|
|
2022-05-09 18:18:01 +02:00
|
|
|
use App\Models\Setting;
|
2021-01-15 14:47:59 +01:00
|
|
|
use Illuminate\Http\Request;
|
|
|
|
|
|
|
|
|
|
class ShowController extends Controller
|
|
|
|
|
{
|
|
|
|
|
public function __construct()
|
|
|
|
|
{
|
|
|
|
|
$this->middleware('auth');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function index(Request $request) {
|
2022-05-09 18:18:01 +02:00
|
|
|
$ShowIsActive = Setting::where('key', '=', 'ShowIsActive')->first();
|
2021-01-15 14:47:59 +01:00
|
|
|
return view('show.index', ['isActive' => $ShowIsActive->value]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function updateStatus(Request $request) {
|
|
|
|
|
$status = $request->status;
|
2022-05-09 18:18:01 +02:00
|
|
|
$d = Setting::where('key', '=', 'ShowIsActive')->first();
|
2021-01-15 14:47:59 +01:00
|
|
|
$d->value = $status;
|
|
|
|
|
$d->save();
|
|
|
|
|
|
2022-05-09 18:18:01 +02:00
|
|
|
$version = Setting::where('key', 'version')->first();
|
2021-01-15 14:47:59 +01:00
|
|
|
$version->value = $version->value + 1;
|
|
|
|
|
$version->save();
|
|
|
|
|
|
|
|
|
|
return redirect()->route('show.index');
|
|
|
|
|
}
|
|
|
|
|
}
|