|
@@ -19,36 +19,22 @@ use Illuminate\Validation\ValidationException;
|
|
|
|
|
|
class UserController extends Controller
|
|
class UserController extends Controller
|
|
{
|
|
{
|
|
- /**
|
|
|
|
- * Display a listing of the resource.
|
|
|
|
- *
|
|
|
|
- * @param Request $request
|
|
|
|
- * @return Application|Factory|View|Response
|
|
|
|
- */
|
|
|
|
- public function index(Request $request)
|
|
|
|
- {
|
|
|
|
- return view('admin.users.index');
|
|
|
|
- }
|
|
|
|
|
|
+ private Pterodactyl $pterodactyl;
|
|
|
|
|
|
- /**
|
|
|
|
- * Show the form for creating a new resource.
|
|
|
|
- *
|
|
|
|
- * @return Response
|
|
|
|
- */
|
|
|
|
- public function create()
|
|
|
|
|
|
+ public function __construct(Pterodactyl $pterodactyl)
|
|
{
|
|
{
|
|
- //
|
|
|
|
|
|
+ $this->pterodactyl = $pterodactyl;
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * Store a newly created resource in storage.
|
|
|
|
|
|
+ * Display a listing of the resource.
|
|
*
|
|
*
|
|
* @param Request $request
|
|
* @param Request $request
|
|
- * @return Response
|
|
|
|
|
|
+ * @return Application|Factory|View|Response
|
|
*/
|
|
*/
|
|
- public function store(Request $request)
|
|
|
|
|
|
+ public function index(Request $request)
|
|
{
|
|
{
|
|
- //
|
|
|
|
|
|
+ return view('admin.users.index');
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -96,7 +82,7 @@ class UserController extends Controller
|
|
"role" => Rule::in(['admin', 'mod', 'client', 'member']),
|
|
"role" => Rule::in(['admin', 'mod', 'client', 'member']),
|
|
]);
|
|
]);
|
|
|
|
|
|
- if (is_null(Pterodactyl::getUser($request->input('pterodactyl_id')))) {
|
|
|
|
|
|
+ if (is_null($this->pterodactyl->getUser($request->input('pterodactyl_id')))) {
|
|
throw ValidationException::withMessages([
|
|
throw ValidationException::withMessages([
|
|
'pterodactyl_id' => ["User does not exists on pterodactyl's panel"]
|
|
'pterodactyl_id' => ["User does not exists on pterodactyl's panel"]
|
|
]);
|
|
]);
|