Listing records from a custom page:
Hello I want to create a custom page for listing records only. I don't want a full resource but I only want a page to list records which will be linked to a certain resource which has already benn created, so I proceeded to create my bew resource as per docs as:
php artisan make:filament-page ActiveLoans --resource=LoanResource --type=custom
Upon creating my custom page I registered my custom page route in the `LoanResource
file class under getPages as shown:
I then went to my newly created custom page class component and added the following files:
The corresponding laravel blade for the custom class looks like this:
However each time I access my route am getting the following exception :
Property [$data] not found on component: [app.filament.resources.loan-resource.pages.active-loans]
What am I missing?5 Replies
Instead of using $this->data, shouldn’t you be able to just use {{ $data }} because it’s already passed to the view?
@Bogardo tried I don't know why its saying Undefined variable $data
Are you a 100% sure that the
$data
variable in your getViewData method has the correct type?@Bogardo you are right I wasn't passing the view to the blade file: this is how It was supposed to be:
@Chanda Glad it’s fixed!