Update AdminController.php

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

View File

@ -44,30 +44,31 @@ class AdminController extends Controller
} }
// 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':
$data['users'] = User::where('role', 'email', 'user')->select('id', 'name', 'littlelink_name', 'role', 'block', 'email_verified_at')->get(); $users = User::where('role', 'user')->select('id', 'email', 'name', 'littlelink_name', 'role', 'block', 'email_verified_at')->get();
return view('panel/users', $data);
break; break;
case 'vip': case 'vip':
$data['users'] = User::where('role', 'email', 'vip')->select('id', 'name', 'littlelink_name', 'role', 'block', 'email_verified_at')->get(); $users = User::where('role', 'vip')->select('id', 'email', 'name', 'littlelink_name', 'role', 'block', 'email_verified_at')->get();
return view('panel/users', $data);
break; break;
case 'admin': case 'admin':
$data['users'] = User::where('role', 'email', 'admin')->select('id', 'name', 'littlelink_name', 'role', 'block', 'email_verified_at')->get(); $users = User::where('role', 'admin')->select('id', 'email', 'name', 'littlelink_name', 'role', 'block', 'email_verified_at')->get();
return view('panel/users', $data);
break; 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)
{ {