Undefined type 'Filament\Forms\Components\Section'.

i read some tutorial and i do use gemini for help, and at the end its said such a cache, i already restart and reinstall and its still happens

about section didnt defined, even though i already write it on the top like this

<?php

namespace App\Filament\Admin\Resources\Categories\Schemas;

use Filament\Forms\Components\TextInput;
use Filament\Forms\Components\Section;

use Filament\Schemas\Schema;
use Illuminate\Support\Str;
use Filament\Forms\Set;

CLASS 'Set'

class CategoryForm
{
public static function configure(Schema $schema): Schema
{
return $schema
->schema([
Section::make('Detail Kategori')
->description('Masukkan nama kategori batik dan slug yang unik.')
->schema([

TextInput::make('name')
->label('Nama Kategori')
->required()
->live(onBlur: true) // Aktifkan Livewire (update real-time)
->maxLength(255)

->afterStateUpdated(fn (string $operation, $state, Set $set) => $operation === 'create' ? $set('slug', Str::slug($state)) : null),


TextInput::make('slug')
->required()
->unique(ignoreRecord: true)
->maxLength(255),
])
]);
}
}



thank you
image.png
image.png
Solution
you are importing it wrong, should be:
Filament\Schemas\Components\Utilities\Set
Filament\Schemas\Components\Section
Was this page helpful?