aboutsummaryrefslogtreecommitdiffhomepage
path: root/app/Http/Controllers/AdminController.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/Http/Controllers/AdminController.php')
-rwxr-xr-xapp/Http/Controllers/AdminController.php28
1 files changed, 0 insertions, 28 deletions
diff --git a/app/Http/Controllers/AdminController.php b/app/Http/Controllers/AdminController.php
deleted file mode 100755
index b3c8443..0000000
--- a/app/Http/Controllers/AdminController.php
+++ /dev/null
@@ -1,28 +0,0 @@
-<?php
-
-namespace App\Http\Controllers;
-
-use Auth;
-use Illuminate\Foundation\Auth\User;
-
-class AdminController extends Controller
-{
- public function Dashboard()
- {
- $this->checkAdmin();
- return view('admin.dashboard', [
- 'user' => Auth::user(),
- 'cpu_load' => round(sys_getloadavg()[1]/(trim(shell_exec("grep -P '^processor' /proc/cpuinfo|wc -l")) + 1)*100, 0)
- ]);
- }
-
- private function checkAdmin()
- {
- $isAdmin = User::findOrFail(Auth::user()->id)->admin;
- if ($isAdmin !== 1) {
- abort(403, 'Sorry, you are not an administrator.');
- }
-
- return true;
- }
-}