hiddenOn returns an error when creating a resource
So, on my app I had to add creation of whitelists. Before that you could only view the resource, you couldn't create it or edit it. Now, we had to add the creation of record. As you know, the view, edit and create are all using the same form. When creating a record now, we get an error:
I've looked through the code and realized it's because of this part:
Right now we only removed it. My question is, how to actually make this work so that I have a planRelation name in the View page?
App\Filament\Resources\WhitelistResource::App\Filament\Resources\{closure}(): Argument #1 ($record) must be of type App\Models\v1\Whitelist, null given, called in /var/task/vendor/filament/support/src/Concerns/EvaluatesClosures.php on line 35I've looked through the code and realized it's because of this part:
Forms\Components\TextInput::make('planRelation.name')
->label('Plan')
->formatStateUsing((function (Whitelist $record): string {
return $record->planRelation->name ?? '';
}))
->hiddenOn(['edit', 'create']),Right now we only removed it. My question is, how to actually make this work so that I have a planRelation name in the View page?