Stricks
Can I use a filament table outside of Filament directories?
I love Filament so much that I want to use its Table feature in another part of my code. This code has nothing to do with Filament. Because this is not a Filament Resource, I don't know how to invoke a Table and feed it headers, columns, etc, as I would in a traditional Resource.
Is this possible to do, or must Tables, with their magical properties, live in a typical Resource PHP file under the Filament directory structure?
49 replies
Find a reporting system that allows for CRUD
I've found lots of reporting tools that let you hard-code a report, both in Laravel, Filament, and plain PHP, but what I am looking for is code that gives a friendly UI, allows the user to pick fields from various SQL tables, add filters, save the report, and of course display it.
Essentially, I want a CRUD-like interface to let users create their own reports, but have a friendly (no actual field names displayed) UI.
I wrote something to do this 12 yrs ago, but I don't want to port it into Laravel/Filament as it has bad UI and only supports AND clauses between JOINed tables.
Does anyone know of code that would do this?
TIA!
1 replies
Clicking on a child record in a table to take you to that record - not edit
I have a form edit for a Parent record that has Child records under it. This works well.
By default, when you click on a Child record in the table, it edits that record in a modal. I want to change that so that the page moves to the Child record in edit mode. I think something like this would work
->url("/childResourceName/childResourceNameId/edit")
, but to do that I would need a value for the childResourceNameId
and I don't know how to get that.
Or am I trying to code this, and there's a way to configure the Filament table to do this?
I've tried this example, but can't get the syntax correct:
Any advice on which way to attack this?13 replies
Making a Form Toggle read-only
I have a boolean field that I'd like to show as a toggle button, but I'd like to disable the button so it's read-only. There doesn't appear to be an attribute to do this.
Or maybe I'm doing this the wrong way. Is there a better way to display a boolean and color code it?
My
is_current_member
boolean is a calculated field, so the user can't control it (thus the need for read-only).
I'm currently using this:
4 replies
multi-tenant: It doesn't filter everwhere
I'm a newbie at Filament, but have the basic many-to-many relations in my tables working and in the UI.
Now I've added multi-tenant, and have it working in the UI for my Resources by including this in the top of each Resource Class:
protected static ?string $tenantOwnershipRelationshipName = 'team';
.
This works well when I am into the UI for reach Resource, but when I am on the default Admin page and have added widgets with this code, it seems to ignore the multi-tenant filter. Or maybe I need to add a Global Scope to filter it? This is the code that is not filtering (eg. shows all records) - any clues?:
7 replies