table for custom page
I created a custom page just to display a table of my OrderResource but I want to filter it where it only shows "order completed"
basically I created this custom page just for SalesReport
but I dont know what is the best way to have a table on my custom page
TIA.
41 Replies
Use a ListPage and define the required methods or follow the table builder docs
im kinda stuck at "npm install" returning error
I dont understand at all what these error means
You use the admin panel right? So there is no need to install anything
ohh, okayyy. But how about the error? is it okay to ignore it?
now i got this error on my admin view
Unable to locate Mix file: /css/filament.css.
While resolving: @vitejs/[email protected]
Found: [email protected]
Could not resolve dependency:
peer vite@"^4.0.0" from @vitejs/[email protected]
hello, i skipped the installation as you said but im having no style at my page?
any reaons?
layouts/app.blade.php
web.php
Table.php
Mix file? You're installing Vite though? Try this setup.
In your
app.blade.php
instead of asset()
you use the following:
have you encountered the same error?
No but that's our productions setup and we have both Filament admin and custom pages with tables for our client app 🙂
That is using the latest Vite
okay, lemme pull my update first, cause I got the error removed on my laptop but only if i uninstall this
this one causing me error if i install it, im thinking maybe something wrong on my setup.
@natadata was able to build successful
but at the end returns this error
@chrysippus2497 Sorry about that I left some stray code in the vite config
I've updated it now
Remove this line
import react from '@vitejs/plugin-react';
It's because we use both livewire and react depending which page you are onthe error was change
sorry idk if this was on my setup...
ohh wait, I have did something wrong on vite.config.js , lemme try again.
its okay now, though my custom page with table looks different, I mean there's no sidebar or anything at all only the table
livere/table.php
Table.php
i haven't run this yet though, maybe its coz of this, i'll try later, ill push this first and rest.
if you're using the admin panel you're making this a lot more difficult that it needs to be. https://filamentphp.com/docs/2.x/admin/resources/custom-pages
Filament
Custom pages - Resources - Admin Panel - Filament
The elegant TALL stack admin panel for Laravel artisans.
im confused, I asked earlier I thought im on the right track putting a table on my custom-page on admin-panel following the table builder docs....
Filament
Getting started - Pages - Admin Panel - Filament
The elegant TALL stack admin panel for Laravel artisans.
yea, but when you are using the admin panel you can just extend the Page class, which is the livewire component, and the view will have the <x-filament::page> blade component in it that will setup the 'shell', ie, navigation, scripts, styles, etc.
ohh...
then you can just add {{ $this->table }} to the blade view
and add all your table traits and methods to the Class that is extending Page
I wasted my entire night debugging then 😆
sorry, didn't realize earlier that you were using the admin panel. It seemed like you were trying to do the standalone versions of the packages.
thankyou for the headsup. could've been way easier.
thanks again.
Sorry for the lost time.
no worries, part of learning ❤️
it worked!!
thank you all for the help ❤️ !!.
gotta continue later 🤘
@awcodes @chrysippus2497 Awesome! I was looking for the same! But I'm receiving this error: Property [$table] not found on component: [app.filament.pages.flavor-report]
Seems like I missed out some portion to initiliaze the table.
@.valpuia I am using a page that I craeted using artisan make:filament-page. Do I need all those methods listed there?
oh, then check this https://filamentphp.com/docs/2.x/admin/dashboard/tables
@.valpuia Thank's a tons. This might be exactly what I might be looking for. Trying it right away
Wc, but I think you need to refer the first link.. check both, one of them will answer your problem
@.valpuia Widget works but it shows up in the main dashboard, and not a different page. So now I need to load this widget into a page?
you can put inside particular resource to avoid showing in dashboard, but like I said, you need to refer the first link (Table)
This is exactly what I'm looking to achieve. A different page where i can load one or two reports. And I will have a tons of these for reports.
ok, How i did was I create one resource (simple) then I change the view using
protected static string $view = 'filament.resources.new-page.index';
from ManageResourcePage.. and from this page, I called my widget (2-3) from getHeaderWidgets()
and I display different table in one page.. hope this helps to achieve what you wantThis looks intuitive!
But resource needs to a have a model, right?
Yes.. can you create new post with your code, error etc and I'll check with you.. extending some other post which is marked "Resolved" is not great..
from your CustomPage that should be located at app/Filament/Pages/CustomPage
u should implement the HasTable
then from your resources/views/filament/pages
there should be a blade-file that has a same name of your CustomPage (e.g custom-page.blade.php) you should call
{{ $this->table }} inside filamenet::page tags
then from your CustomPage u can modify what you want to do, like
getTableQuery()
getTableColumns()
getTableFilters()
etc..
don't forget to put
use InteractsWithTable;
inside your class
Thank YOu @chrysippus2497