3
0
Fork 0
This repository has been archived on 2024-11-14. You can view files and clone it, but cannot push or open issues or pull requests.
ThemeParkPlus-Panel/app/Http/Controllers/Panel/HomeController.php

42 lines
937 B
PHP
Raw Permalink Normal View History

2020-02-26 13:59:58 +00:00
<?php
namespace App\Http\Controllers\Panel;
use App\Http\Controllers\Controller;
2021-06-27 19:01:43 +00:00
use App\Show;
use App\User;
use Illuminate\Support\Facades\DB;
2020-02-26 13:59:58 +00:00
class HomeController extends Controller
{
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
2021-06-27 19:01:43 +00:00
$this->middleware(['auth', 'verified', '2fa', 'admin']);
2020-02-26 13:59:58 +00:00
}
/**
* Show the application dashboard.
*
* @return \Illuminate\Contracts\Support\Renderable
*/
public function index()
{
2021-06-27 19:01:43 +00:00
$users = User::count();
2021-06-29 20:05:00 +00:00
$regions = DB::table('regions')->count();
$attractions = DB::table('attractions')->count();
$shows = env('SHOWS', false) ? Show::count() : 0;
2020-02-26 13:59:58 +00:00
return view('panel.home')->with([
2021-06-27 19:01:43 +00:00
'users' => $users,
'regions' => $regions,
'attractions' => $attractions,
'shows' => $shows
2020-02-26 13:59:58 +00:00
]);
}
}