F
Filament3mo ago
AJN

I can't get the submit button to show on a Filament-livewire form

Submit button on create action not showing My Form Modal does not show a submit button
<?php

namespace App\Livewire;

use App\Models\Race;
use Filament\Actions\Action;
use Filament\Actions\Concerns\InteractsWithActions;
use Filament\Actions\Contracts\HasActions;
use Filament\Actions\CreateAction;
use Filament\Forms\Components\Repeater;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Concerns\InteractsWithForms;
use Filament\Forms\Contracts\HasForms;
use Filament\Forms\Form;
use Filament\Notifications\Notification;
use Filament\Pages\Concerns\InteractsWithFormActions;
use Filament\Support\Enums\MaxWidth;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\HtmlString;
use Livewire\Component;

class RaceForm extends Component implements HasForms, HasActions
{

use InteractsWithActions;
use InteractsWithForms;

public Race $race;

public function create()
{

}

public function form(Form $form): Form
{
return $form
->schema(Race::getForm());
}


public function showAction(): Action
{
return Action::make('show')
->model(Race::class)
->form(Race::getForm())
->slideOver(true)
->successNotificationTitle('Race Submitted - Pending Approval From Admin')->modalFooterActions()
->submit('Submit')
->modalFooterActions([Action::make('submit')
->label('Link item to inventory')]);
}

public function getFormActions(): array
{
return [
Action::make('save')->action(
function (): void {
$this->update();
}
),
];
}

public function render()
{
return view('livewire.race-form');
}




}
<?php

namespace App\Livewire;

use App\Models\Race;
use Filament\Actions\Action;
use Filament\Actions\Concerns\InteractsWithActions;
use Filament\Actions\Contracts\HasActions;
use Filament\Actions\CreateAction;
use Filament\Forms\Components\Repeater;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Concerns\InteractsWithForms;
use Filament\Forms\Contracts\HasForms;
use Filament\Forms\Form;
use Filament\Notifications\Notification;
use Filament\Pages\Concerns\InteractsWithFormActions;
use Filament\Support\Enums\MaxWidth;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\HtmlString;
use Livewire\Component;

class RaceForm extends Component implements HasForms, HasActions
{

use InteractsWithActions;
use InteractsWithForms;

public Race $race;

public function create()
{

}

public function form(Form $form): Form
{
return $form
->schema(Race::getForm());
}


public function showAction(): Action
{
return Action::make('show')
->model(Race::class)
->form(Race::getForm())
->slideOver(true)
->successNotificationTitle('Race Submitted - Pending Approval From Admin')->modalFooterActions()
->submit('Submit')
->modalFooterActions([Action::make('submit')
->label('Link item to inventory')]);
}

public function getFormActions(): array
{
return [
Action::make('save')->action(
function (): void {
$this->update();
}
),
];
}

public function render()
{
return view('livewire.race-form');
}




}
I followed laracasts trying to create this with my form but can't sumbit or see the submit button.
No description
4 Replies
Vp
Vp3mo ago
Follow this https://filamentphp.com/docs/3.x/forms/adding-a-form-to-a-livewire-component#adding-the-form scroll down a bit and you'll see blade file with button You can also use this components https://filamentphp.com/docs/3.x/support/blade-components/button for button
AJN
AJNOP3mo ago
But this is not just a form, it is an Action that has a form inside it, I can't add html for the submit button
Vp
Vp3mo ago
Can you show your blade file, did you add {{ $this->showAction }}?
AJN
AJNOP3mo ago
I fixed it -it was a tailwind config issue
Want results from more Discord servers?
Add your server