!!AhmedDev π
FFilament
β’Created by !!AhmedDev π on 8/18/2024 in #ββhelp
The submit button not disabled when indicator loading ...
How to solve this issue guy's:
Check below snippet:
public static function form(Form $form): Form
{
return $form
->schema([
Forms\Components\TextInput::make('title')
->label(__('attributes.title'))
->required()
->maxLength(255)
->unique(ignoreRecord: true)
->afterStateUpdated(function (string $operation, $state, Set $set) {
if ($operation !== 'create') {
return;
}
$set('slug', Str::slug($state));
}),
Forms\Components\TextInput::make('slug')
->label(__('attributes.slug'))
->disabled()
->dehydrated()
->required()
->unique(Blog::class, 'slug', ignoreRecord: true),
RichEditor::make('excerpt')
->label(__('attributes.excerpt'))
->toolbarButtons(
ExtendedModel::getToolbarButtons()
),
RichEditor::make('content')
->label(__('attributes.content'))
->toolbarButtons(
ExtendedModel::getToolbarButtons()
),
Forms\Components\TagsInput::make('keyword')
->label(__('attributes.keyword'))
->splitKeys(['Tab', ' ']),
Forms\Components\Toggle::make('status')
->label(__('attributes.status'))
->required()
->default(true),
SpatieMediaLibraryFileUpload::make('thumb')
->collection('thumbs'),
SpatieMediaLibraryFileUpload::make('header')
->collection('headers')
]);
}
public static function table(Table $table): Table
{
return $table
->columns([
Tables\Columns\TextColumn::make('title')
->label(__('attributes.name'))
->searchable(),
Tables\Columns\TextColumn::make('excerpt')
->html()
->wrap()
->label(__('attributes.excerpt'))
->searchable(),
Tables\Columns\IconColumn::make('status')
->label(__('attributes.status'))
->boolean()
->sortable(),
Tables\Columns\TextColumn::make('created_at')
->dateTime()
->sortable()
->toggleable(isToggledHiddenByDefault: true),
Tables\Columns\TextColumn::make('updated_at')
->dateTime()
->sortable()
->toggleable(isToggledHiddenByDefault: true),
])
->filters([
//
])
->actions([
Tables\Actions\ActionGroup::make([
Tables\Actions\EditAction::make(),
Tables\Actions\DeleteAction::make(),
])
])
->bulkActions([
Tables\Actions\BulkActionGroup::make([
Tables\Actions\DeleteBulkAction::make(),
]),
]);
}
public static function form(Form $form): Form
{
return $form
->schema([
Forms\Components\TextInput::make('title')
->label(__('attributes.title'))
->required()
->maxLength(255)
->unique(ignoreRecord: true)
->afterStateUpdated(function (string $operation, $state, Set $set) {
if ($operation !== 'create') {
return;
}
$set('slug', Str::slug($state));
}),
Forms\Components\TextInput::make('slug')
->label(__('attributes.slug'))
->disabled()
->dehydrated()
->required()
->unique(Blog::class, 'slug', ignoreRecord: true),
RichEditor::make('excerpt')
->label(__('attributes.excerpt'))
->toolbarButtons(
ExtendedModel::getToolbarButtons()
),
RichEditor::make('content')
->label(__('attributes.content'))
->toolbarButtons(
ExtendedModel::getToolbarButtons()
),
Forms\Components\TagsInput::make('keyword')
->label(__('attributes.keyword'))
->splitKeys(['Tab', ' ']),
Forms\Components\Toggle::make('status')
->label(__('attributes.status'))
->required()
->default(true),
SpatieMediaLibraryFileUpload::make('thumb')
->collection('thumbs'),
SpatieMediaLibraryFileUpload::make('header')
->collection('headers')
]);
}
public static function table(Table $table): Table
{
return $table
->columns([
Tables\Columns\TextColumn::make('title')
->label(__('attributes.name'))
->searchable(),
Tables\Columns\TextColumn::make('excerpt')
->html()
->wrap()
->label(__('attributes.excerpt'))
->searchable(),
Tables\Columns\IconColumn::make('status')
->label(__('attributes.status'))
->boolean()
->sortable(),
Tables\Columns\TextColumn::make('created_at')
->dateTime()
->sortable()
->toggleable(isToggledHiddenByDefault: true),
Tables\Columns\TextColumn::make('updated_at')
->dateTime()
->sortable()
->toggleable(isToggledHiddenByDefault: true),
])
->filters([
//
])
->actions([
Tables\Actions\ActionGroup::make([
Tables\Actions\EditAction::make(),
Tables\Actions\DeleteAction::make(),
])
])
->bulkActions([
Tables\Actions\BulkActionGroup::make([
Tables\Actions\DeleteBulkAction::make(),
]),
]);
}
12 replies