After update using Section Component gives TypeError

public static function form(Form $form): Form { return $form ->schema([ Forms\Components\Section::make() ->schema([ Forms\Components\TextInput::make('year') ->required() ->numeric(), Forms\Components\TextInput::make('rate_first_tier') ->required() ->numeric(), Forms\Components\TextInput::make('rate_second_tier') ->required() ->numeric(), Forms\Components\TextInput::make('rate_third_tier') ->required() ->numeric(), Forms\Components\TextInput::make('ex_tax') ->required() ->numeric(), ]) ->columns(2)        ]);     } Images are before and after.
No description
No description
14 Replies
Np
Np7mo ago
Check is there any trim() helper used in your code @ZetniKovjek
ZetniKovjek
ZetniKovjek7mo ago
Thanks for ur reply. I havent added one of those as far as i can tell Any other suggestions?
awcodes
awcodes7mo ago
Can you share the flare link please.?
ZetniKovjek
ZetniKovjek7mo ago
Flare link? If i reve this part: Forms\Components\Section::make() ]) ->columns(2) It works Remove*
DrByte
DrByte7mo ago
Clicking the "Share" in the top-right of your Error page will give you a link to share the error page via Flare. It helps with debugging because the stack-trace is explorable to find out where the error is getting triggered.
No description
ZetniKovjek
ZetniKovjek7mo ago
Aah my bad. I'll do that tomorrow Thanks in advance
ZetniKovjek
ZetniKovjek7mo ago
This is the flare URL: https://flareapp.io/share/v5pxlZA5
Flare
trim(): Argument #1 ($string) must be of type string, array given - The error occurred at https://yesenergie.local.batao.nl/admin/users/create
awcodes
awcodes7mo ago
I think you have to provide a name for the section
Section::make('name')
Section::make('name')
without it it's breaking the state path i think other than that your code looks ok
ZetniKovjek
ZetniKovjek7mo ago
Yeah i tried removing the 'name' part but no luck sadly
awcodes
awcodes7mo ago
Double check your data and model too. Make sure none of the fields are getting cast as an array.
ZetniKovjek
ZetniKovjek7mo ago
I actually tried it on one of my simplest model. <?php declare(strict_types=1); namespace App\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class TaxRebate extends Model { use HasFactory; protected $fillable = [ 'year', 'rate_first_tier', 'rate_second_tier', 'rate_third_tier', 'ex_tax', ]; }
ZetniKovjek
ZetniKovjek7mo ago
The resource
ZetniKovjek
ZetniKovjek7mo ago
And this is the page/create: <?php declare(strict_types=1); namespace App\Filament\Resources\TaxRebateResource\Pages; use App\Filament\Resources\TaxRebateResource; use Filament\Resources\Pages\CreateRecord; class CreateTaxRebate extends CreateRecord { protected static string $resource = TaxRebateResource::class; } So quite basic
DrByte
DrByte6mo ago
Is this still an issue? If yes, which specific Filament version triggers it? (You said it started "after update" ... but didn't say what version you upgraded From and To) Also, does removing declare(strict_types=1); as a temporary investigative step, make any difference?
Want results from more Discord servers?
Add your server
More Posts