Update AdminController.php

This commit is contained in:
Julian Prieber 2023-02-14 13:13:35 +01:00
parent 50bf79a800
commit 2798c1f8d1

View File

@ -43,31 +43,32 @@ class AdminController extends Controller
return view('panel/index', ['littlelink_name' => $littlelink_name, 'links' => $links, 'clicks' => $clicks, 'siteLinks' => $siteLinks, 'siteClicks' => $siteClicks, 'userNumber' => $userNumber]); return view('panel/index', ['littlelink_name' => $littlelink_name, 'links' => $links, 'clicks' => $clicks, 'siteLinks' => $siteLinks, 'siteClicks' => $siteClicks, 'userNumber' => $userNumber]);
} }
//Get users by type // Get users by type
public function users(request $request) public function users(Request $request)
{ {
$usersType = $request->type; $usersType = $request->type;
switch ($usersType) { switch ($usersType) {
case 'all': case 'all':
$data['users'] = User::select('id', 'name', 'email', 'littlelink_name', 'role', 'block', 'email_verified_at')->get(); $users = User::select('id', 'name', 'email', 'littlelink_name', 'role', 'block', 'email_verified_at')->get();
return view('panel/users', $data); break;
break; case 'user':
case 'user': $users = User::where('role', 'user')->select('id', 'email', 'name', 'littlelink_name', 'role', 'block', 'email_verified_at')->get();
$data['users'] = User::where('role', 'email', 'user')->select('id', 'name', 'littlelink_name', 'role', 'block', 'email_verified_at')->get(); break;
return view('panel/users', $data); case 'vip':
break; $users = User::where('role', 'vip')->select('id', 'email', 'name', 'littlelink_name', 'role', 'block', 'email_verified_at')->get();
case 'vip': break;
$data['users'] = User::where('role', 'email', 'vip')->select('id', 'name', 'littlelink_name', 'role', 'block', 'email_verified_at')->get(); case 'admin':
return view('panel/users', $data); $users = User::where('role', 'admin')->select('id', 'email', 'name', 'littlelink_name', 'role', 'block', 'email_verified_at')->get();
break; break;
case 'admin':
$data['users'] = User::where('role', 'email', 'admin')->select('id', 'name', 'littlelink_name', 'role', 'block', 'email_verified_at')->get();
return view('panel/users', $data);
break;
}
} }
$data['users'] = $users;
return view('panel/users', $data);
}
//Search user by name //Search user by name
public function searchUser(request $request) public function searchUser(request $request)
{ {