validated(); $validated['is_admin'] = false; $validated['password'] = Str::random(8); $validated['status'] = true; try { $user = User::create($validated); }catch (Throwable $exception){ return response() ->json($exception); } return response() ->json(['message' => 'Successfully created user ' . $user->firstname]); } public function getUser(Request $request, User $user) { return response() ->json(["status" => true]); } }