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')

In the table a working
  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'),

Do I need to use a select and make it read only?

Model
 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()
Was this page helpful?