Preventing Duplicate 'Active' Records in Model Using Filament

Hello, I'm new to using filament, how can I prevent a new record in my SchoolDiar model from being written if another record with 'active' with value 'Ativa' already exists?

     public static function form(Form $form): Form
    {
        return $form
            ->schema([
                Select::make('active')
                    ->options(['Ativa' => 'Ativa', 'Inativa' => 'Inativa'])
                    ->native(false)
                    ->default('Inativa')
                    ->label('Status'),
              
    }
Was this page helpful?