Can I display a relation in Forms like I can in Table?

In my CampaignResource I have a title In the form a working Select
Forms\Components\Select::make('title_id')
->relationship('title', 'name')
Forms\Components\Select::make('title_id')
->relationship('title', 'name')
In the table a working
Tables\Columns\TextColumn::make('title.name'),
Tables\Columns\TextColumn::make('title.name'),
But this doesn't work in the form... I want to display only. Not allow change at a certain point,
Forms\Components\TextInput::make('title.name')
->label('Title'),

Forms\Components\TextInput::make('title.name')
->label('Title'),

Do I need to use a select and make it read only? Model
public function title(): BelongsTo
{
return $this->belongsTo(Title::class);
}
public function title(): BelongsTo
{
return $this->belongsTo(Title::class);
}
Solution:
You can use a placeholder and provide the value yourself or use the Select and make it ->disabled()
Jump to solution
2 Replies
Solution
Dennis Koch
Dennis Koch2w ago
You can use a placeholder and provide the value yourself or use the Select and make it ->disabled()
ddoddsr
ddoddsr2w ago
Placeholder::make('person_name') ->content(fn (Campaign $record): string => $record->persona->name), So easy thanks
Want results from more Discord servers?
Add your server
More Posts
Issue With Searchable SelectHey All - I have a dynamically created schema as shown below: ``` ->schema(function ($record) { $cresource authorization simple questionHey in my app I have a schools resource, super admins can make,view, edit and delete any school. rerule#👹┊no-help-only-pets اريد تحقق ان كان مبلغ الذي اريد اظافته اكبر من باقي فلا يستطيع عميل اظافته $Stuck on adding a livewire form modal as extraItemActions that is connected to another modelI have followed the steps on https://filamentphp.com/docs/3.x/forms/adding-a-form-to-a-livewire-compImport CSV inside a resource page to save exported data to a relationship table.Hello there. I have an order resource page, and a repeater inside of it to add products to the orderIs it possible to make clusters side navbar collapsible?I've been reading the documentation and i found that i can make the general nav bar collapsible addiHow require confirmation for TextInputColumn?I want to request confirmation to update a field to avoid accidental entry for Tables\Columns\TextInSQLSTATE[HY000]: General error: 1364 Field 'slug' doesn't have a default valueI tried to create a new tag in Filament, this is my Filament tag form: ``` public static functiHow to download failed rows?Hi, I have an import action when I click on the link to download the failed rows, I get redirected Editing related models in their own ResourceI have a RelationManager in a Resource. The relation also has it's own resource, but I use the Relat