- Added `priority` column to `roles` table with migration and model updates. - Introduced priority management methods in `RoleService` and validation logic for updates. - Enhanced access-manager UI to display and edit role priorities via a modal. - Updated related data classes and views to support and handle the new priority field.
25 lines
672 B
PHP
25 lines
672 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Data\Role;
|
|
|
|
use App\Data\Permissions\PermissionData;
|
|
use Spatie\LaravelData\Attributes\DataCollectionOf;
|
|
use Spatie\LaravelData\{Data, DataCollection};
|
|
|
|
final class RoleData extends Data
|
|
{
|
|
public function __construct(
|
|
public int $id,
|
|
public string $name,
|
|
public int $priority = 0,
|
|
#[DataCollectionOf(class: RoleAppData::class)]
|
|
public ?DataCollection $apps = null,
|
|
#[DataCollectionOf(class: RoleUserData::class)]
|
|
public ?DataCollection $users = null,
|
|
#[DataCollectionOf(PermissionData::class)]
|
|
public ?DataCollection $permissions = null,
|
|
) {}
|
|
}
|