Passing props to a custom column
I have the following custom column
Is there a way to pass the props from the resource?
Solution:Jump to solution
add in your MediaObjectColumn class
```php
protected string|Closure|null $title = null;
...
7 Replies
Solution
add in your MediaObjectColumn class
in the view
that worked! really appreciate the help π
Hi, how can I pass the instance of the record as a parameter. Say I wanted to passar the current record as title
If you want to access the record, I think you can use
{{ $getRecord() }}
As I want to reuse this column, I prefer to pass it as a parameter. In the TextColumn I can use formatStateUsing(fn ($record) => $record)
$getRecord() will work by default in any custom column. No need to pass it.
After a lot of digging, I had to do it in the view of my component, so in the end you have a $getTitle() for it to work. Probably because of the evaluate function that handles the data.