Relation on text area form?
i have a text area which is getting the relation from message model and i am currently in direct message modal so how can i get the data in our form and edit the message i created the form but i am getting the i of the message how can i do that ?
Tables\Columns\TextColumn::make('message.content')
->sortable()
->toggleable(isToggledHiddenByDefault: false)
->searchable()
->label('Message Content')->limit(50),
Solution:Jump to solution
You can, just specify with
->model(Event::class)
like
```php
Select::make('event_type_id')
->model(Event::class)...13 Replies
To understand a little better, do you want to get the content of the message and not the ID?
yes
@Altffenser in my table column it's working fine but in form it is getting id because it is in relation
like that and in this message i have a field named content which is i called in the column. like that message.content
like that and in this message i have a field named content which is i called in the column. like that message.content
Could you share the code of your table to have a little more context?
firstly
i was using this which result is on given image and
currently i am using this
but i want a textarea not select form.
my current approach is that
@Altffenser is this approach is good or i should use textarea ?
It is not, I was able to do it with textarea without any problem. It may help to specify the model.
and specify the model with
->form({})->model(Event::class)
we can not do it directly? like that in form
?
yeah it is also working for me.
but my question is that can we use relation directly to the textarea. insted of select form
Solution
You can, just specify with
->model(Event::class)
like
This way above works too
Okay, thanks.now I understand. I really appreciate it thank you .