- Replaced `duration` (integer, days) with `validUpto` (datetime) in role-app assignments. - Updated `AssignAppsToRoleData`, `AppRole` model, and Livewire forms to adopt the new `validUpto` field. - Adjusted database migrations and UI components to reflect the change in validity representation. - Enhanced validity date inputs with support for "Unlimited" roles using toggles.
30 lines
650 B
PHP
30 lines
650 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Livewire\Forms;
|
|
|
|
use Livewire\Attributes\Validate;
|
|
use Livewire\Form;
|
|
|
|
class AssignAppToRoleForm extends Form
|
|
{
|
|
#[Validate([
|
|
'appIds' => 'required|array|min:1',
|
|
'appIds.*' => 'integer|exists:connected_apps,id',
|
|
])]
|
|
public array $appIds = [];
|
|
|
|
#[Validate('exclude_if:isUnlimited,true|required|date|after_or_equal:today')]
|
|
public ?string $validUpto = null;
|
|
|
|
public bool $isUnlimited = false;
|
|
|
|
public function reset(mixed ...$properties): void
|
|
{
|
|
$this->resetErrorBag();
|
|
parent::reset(...$properties);
|
|
$this->validUpto = null;
|
|
}
|
|
}
|