Level 2
Instead of showOnIndex() try onlyOnIndex() or exceptOnForms().
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi,
I have 2 resources/models and I want to display a value from a resource on a index, this works fine, but then when i go to update the detail from the index, I get an error trying to get property of non object. I don't want this value to be updated though, only displayed on the index. I don't want to make the field but display it on the index if that makes sense.
Any ideas on what I am doing wrong?
DateTime::make('Apt Time', function () { return $this->appointments->first()->apt_time; })->showOnIndex()->format('DD MMM YYYY HH:mm'),
Thanks
Please or to participate in this conversation.