how to call model inside custom page resource
Hi, I created a custom page ViewTickets from RootInformationResource.
I want to fetch the hasMany relation data from the Participants table, but instead, I got an error like this.
How to use the model inside the custom page resource I think I wrote the code wrong
Thank you, and may your day be blessed!
![No description](https://answer-overflow-discord-attachments.s3.amazonaws.com/1219655719138234441/image.png)
Solution:Jump to solution
- import the Participant
use App\Models\Participant;
```php
protected function getViewData(): array
{...2 Replies
Solution
- import the Participant
use App\Models\Participant;
use $items
in the viewHi, Thank you for responding to my question.
Already try your solution and it works! Thank you so much, you're so great! Have a nice day!