Lot's of bug fixes
This commit is contained in:
parent
ad320963fc
commit
7718ed6c32
196 changed files with 51167 additions and 3010 deletions
45
app/Http/Controllers/ControlController.php
Normal file
45
app/Http/Controllers/ControlController.php
Normal file
|
@ -0,0 +1,45 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
|
||||
use App\Color\MinecraftColor;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Redirect;
|
||||
|
||||
class ControlController extends Controller
|
||||
{
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware(['auth', 'verified', '2fa']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the application dashboard.
|
||||
*
|
||||
* @param $attraction_id
|
||||
* @param $pin
|
||||
* @return \Illuminate\Contracts\Support\Renderable
|
||||
*/
|
||||
public function index($attraction_id, $pin)
|
||||
{
|
||||
if(!preg_match('/^([0-9]){9}$/', $pin))
|
||||
return Redirect::route('status');
|
||||
|
||||
$data = DB::table('attraction')->select('name')->where('id', '=', $attraction_id)->first();
|
||||
if(empty($data))
|
||||
return Redirect::route('status');
|
||||
|
||||
return view('control')->with([
|
||||
'attraction_id' => $attraction_id,
|
||||
'attraction_name' => MinecraftColor::stripColor( $data->name),
|
||||
'pin' => $pin
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
Reference in a new issue