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
2021-06-29 22:05:00 +02:00

41 lines
937 B
PHP

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