<?php

namespace App\Http\Controllers;

use App\Models\User;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Validation\ValidationException;
use Laravel\Sanctum\PersonalAccessToken;
use Illuminate\Validation\Rule;

class RoleController extends Controller
{
    public function getRoles(Request $request): JsonResponse
    {
        $roles= \Spatie\Permission\Models\Role::get()->toArray();
        $rolesName= array_column($roles,'name');
        return response()->json([
            'data' => $rolesName,
        ], JsonResponse::HTTP_OK);
    }
}
