Ryuuuu
Ryuuuu
Explore posts from servers
FFilament
Created by Ryuuuu on 12/18/2024 in #❓┊help
statePath variable missing some form fields
thank you so much for the help 😄
28 replies
FFilament
Created by Ryuuuu on 12/18/2024 in #❓┊help
statePath variable missing some form fields
didn't realize fill does multiple things under the hood
28 replies
FFilament
Created by Ryuuuu on 12/18/2024 in #❓┊help
statePath variable missing some form fields
i put it in for all them and it works perfectly now after removing the manual field i put in the $data3 variable
28 replies
FFilament
Created by Ryuuuu on 12/18/2024 in #❓┊help
statePath variable missing some form fields
ah yeah that was definitely it, i looked again and actually form4 had a little bit of default data using fill too which is why it didnt have any problems like form3
28 replies
FFilament
Created by Ryuuuu on 12/18/2024 in #❓┊help
statePath variable missing some form fields
would just an empty one work? $this->form3->fill();? or should i specify all of the fields
28 replies
FFilament
Created by Ryuuuu on 12/18/2024 in #❓┊help
statePath variable missing some form fields
form1 has some data coming from the DB that i have to prefill in there which i did using formFill
28 replies
FFilament
Created by Ryuuuu on 12/18/2024 in #❓┊help
statePath variable missing some form fields
do i need to call it to initialize the $data anyway?
28 replies
FFilament
Created by Ryuuuu on 12/18/2024 in #❓┊help
statePath variable missing some form fields
these 2 don't have any default data
28 replies
FFilament
Created by Ryuuuu on 12/18/2024 in #❓┊help
statePath variable missing some form fields
only for the ones that need some default data
28 replies
FFilament
Created by Ryuuuu on 12/18/2024 in #❓┊help
statePath variable missing some form fields
and in the blade its just {{ $this->form1 }}
28 replies
FFilament
Created by Ryuuuu on 12/18/2024 in #❓┊help
statePath variable missing some form fields
these are only the relevant parts of my .php file
28 replies
FFilament
Created by Ryuuuu on 12/18/2024 in #❓┊help
statePath variable missing some form fields
i have them in separate files to be cleaner but i moved it all so it fits in 1 discord message
28 replies
FFilament
Created by Ryuuuu on 12/18/2024 in #❓┊help
statePath variable missing some form fields
protected function getForms(): array
{
return [
'form1',
'form2',
'form3',
'form4',
'form5',
];
}
/**
* @var array<string, mixed> | null
*/
public ?array $data3 = ["note" => ""];

/**
* @var array<string, mixed> | null
*/
public ?array $data4 = [];

public function form3(Form $form3): Form
{
return $form3->schema([
Section::make('Section1')
->schema([
Select::make('level')
->label('Level')
->required()
->options([
'draft' => 'Draft',
'reviewing' => 'Reviewing',
'published' => 'Published',
]),
Textarea::make('note')
->label('Note')
->placeholder('notes')
->nullable(),
])
->columns(1)
->collapsible()
])
->statePath('data3');
}

public function form4(Form $form4): Form
{
return $form4->schema([
Section::make('Section1')
->schema(
[
TextInput::make('input1')
->label('Input1')
->integer()
->required(),
TextInput::make('input2')
->label('Input2')
->integer()
->required(),
]
)
->collapsible()
])
->statePath('data4');
}
protected function getForms(): array
{
return [
'form1',
'form2',
'form3',
'form4',
'form5',
];
}
/**
* @var array<string, mixed> | null
*/
public ?array $data3 = ["note" => ""];

/**
* @var array<string, mixed> | null
*/
public ?array $data4 = [];

public function form3(Form $form3): Form
{
return $form3->schema([
Section::make('Section1')
->schema([
Select::make('level')
->label('Level')
->required()
->options([
'draft' => 'Draft',
'reviewing' => 'Reviewing',
'published' => 'Published',
]),
Textarea::make('note')
->label('Note')
->placeholder('notes')
->nullable(),
])
->columns(1)
->collapsible()
])
->statePath('data3');
}

public function form4(Form $form4): Form
{
return $form4->schema([
Section::make('Section1')
->schema(
[
TextInput::make('input1')
->label('Input1')
->integer()
->required(),
TextInput::make('input2')
->label('Input2')
->integer()
->required(),
]
)
->collapsible()
])
->statePath('data4');
}
28 replies
FFilament
Created by Ryuuuu on 12/18/2024 in #❓┊help
statePath variable missing some form fields
something like this
28 replies
FFilament
Created by Ryuuuu on 12/18/2024 in #❓┊help
statePath variable missing some form fields
ill just put one of the form that works and one that doesnt
28 replies
FFilament
Created by Ryuuuu on 12/18/2024 in #❓┊help
statePath variable missing some form fields
yeah let me see how i can make it readable 1 sec
28 replies
FFilament
Created by Ryuuuu on 12/18/2024 in #❓┊help
statePath variable missing some form fields
and then used that variable name in the forms statePath option
28 replies
FFilament
Created by Ryuuuu on 12/18/2024 in #❓┊help
statePath variable missing some form fields
something like public ?array $data1 = []; public ?array $data2 = []; public ?array $data3 = []; etc.
28 replies
FFilament
Created by Ryuuuu on 12/18/2024 in #❓┊help
statePath variable missing some form fields
no, i've declared different data objects for each of them
28 replies
FFilament
Created by Ryuuuu on 12/17/2024 in #❓┊help
Validate filament form without submitting
thank you so much
18 replies