feat(authorization): refactor role management to use RoleCode enum, update migrations, seeders, and tests

This commit is contained in:
2026-07-31 08:32:00 -03:00
parent a087a511e0
commit b7e1332b8c
11 changed files with 82 additions and 151 deletions

View File

@@ -2,6 +2,7 @@
namespace App\Domains\Tenant\Controllers;
use App\Domains\Authorization\Enums\RoleCode;
use App\Domains\Tenant\Models\Tenant;
use App\Domains\Tenant\Requests\BootstrapTenantRequest;
use App\Domains\Tenant\Resources\TenantResource;
@@ -27,7 +28,7 @@ class BootstrapTenantController extends Controller
[
'menues' => fn ($query) => $query->whereHas(
'roles',
fn ($query) => $query->where('codigo', 'user')
fn ($query) => $query->where('codigo', RoleCode::User->value)
),
'categories' => fn ($query) => $query->orderBy('nombre'),
]