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(),
]),
]);
}
6 Replies
!!AhmedDev πŸ•Š
!!AhmedDev πŸ•Šβ€’3mo ago
@Answer Overflow #β“β”Šhelp @Aaron Lawrence @Dan Harrin @mile4841
Rami Marashdeh
Rami Marashdehβ€’3mo ago
you have to add this function on class CreateClass, until this issue fixed
public function beforeCreate(){
$this->data = null;
}
public function beforeCreate(){
$this->data = null;
}
ModestasV
ModestasVβ€’3mo ago
Please do not tag people! #βœ…β”Šrules
Dennis Koch
Dennis Kochβ€’3mo ago
Already warned him and gave him a day off
ModestasV
ModestasVβ€’3mo ago
Lovely!
Aaron Lawrence
Aaron Lawrenceβ€’3mo ago
I wanted to say something myself 🀐 πŸ˜„
Want results from more Discord servers?
Add your server