You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've followed all steps and when rendering the page it is triggering this error
Property [$form] not found on component: [post-form]
resources/views/livewire/post-form.blade.php :3
<div>
<form wire:submit="create">
{{ $this->form }}
<button type="submit">
Submit
</button>
</form>
<x-filament-actions::modals />
</div>
While my \App\LivewirePostForm.php is
<?php
namespace App\Livewire;
use App\Models\Material;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Components\MarkdownEditor;
use Filament\Forms\Concerns\InteractsWithForms;
use Filament\Forms\Contracts\HasForms;
use Filament\Forms\Form;
use Illuminate\Contracts\View\View;
use Livewire\Component;
class PostForm extends Component implements HasForms
{
use InteractsWithForms;
public ?array $data = [];
public function mount(): void
{
$this->form->fill();
}
public function form(Form $form): Form
{
return $form
->schema([
TextInput::make('title')
->required(),
MarkdownEditor::make('content'),
// ...
])
->statePath('data');
}
public function create(): void
{
dd($this->form->getState());
}
public function render(): View
{
return view('livewire.create-post');
}
}
The removing {{ $this->form }} from livewire view, everything renders fine, but obviously with no form inside.
My environment is:
Environment ................................................................
Application Name ..................................................... Posts
Laravel Version .................................................... 11.44.2
PHP Version .......................................................... 8.4.5
Composer Version ..................................................... 2.8.6
Environment .......................................................... local
Debug Mode ......................................................... ENABLED
URL ............................................................. posts.test
Maintenance Mode ....................................................... OFF
Timezone ............................................................... UTC
Locale .................................................................. es
Cache ......................................................................
Config .......................................................... NOT CACHED
Events .......................................................... NOT CACHED
Routes .......................................................... NOT CACHED
Views ............................................................... CACHED
Drivers ....................................................................
Broadcasting ........................................................... log
Cache ................................................................. file
Database ............................................................. mysql
Logs ......................................................... stack / daily
Mail ................................................................... log
Queue ................................................................. sync
Session ............................................................... file
Filament ...................................................................
Blade Icons ..................................................... NOT CACHED
Packages ................... filament, forms, notifications, support, tables
Panel Components ................................................ NOT CACHED
Version ............................................................. v3.3.4
Views ........................................................ NOT PUBLISHED
Livewire ...................................................................
Livewire ............................................................ v3.6.2
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Package
Panel builder
Package Version
v3.3.4
How can we help you?
Hi everybody! I'm trying to add a filament form to a livewire component following docs examples from here: https://filamentphp.com/docs/3.x/forms/adding-a-form-to-a-livewire-component
I've followed all steps and when rendering the page it is triggering this error
While my \App\LivewirePostForm.php is
The removing
{{ $this->form }}from livewire view, everything renders fine, but obviously with no form inside.My environment is:
Thanks for any light!
Beta Was this translation helpful? Give feedback.
All reactions