MarconiMamba
MarconiMamba
FFilament
Created by MarconiMamba on 11/2/2023 in #❓┊help
Only allow clipboard pasting, not typing, into a field.
I have a field where users should be pasting in content from another tool, and not directly entering information into a Textarea. Is there a way to control a field so the user cannot type into the Textarea, but can paste into it. Or is there a better method than using a Textarea to let the user throw stuff from the clipboard into the form? OR Is it possible to use a fileUpload, but instead of uploading the file to my storage, it just pulls the content of the (xml) file and fills in a readOnly field?
11 replies
FFilament
Created by MarconiMamba on 10/30/2023 in #❓┊help
filling fields based on content of other fields.
I have a textarea where users are expected to paste in some structured XML, I would like to take the attributes of the top level XML Element and set the other fields in the form to these element's values and remove the top level element before it is stored into the database. Is logic and parsing like this possible with vanilla filament? I expect I'll have to use some sort of regex unless XML parsing is possible at runtime like this.
4 replies
FFilament
Created by MarconiMamba on 10/20/2023 in #❓┊help
Block DetachAction on some list items
Is there a way to block certain users from detaching certain records from a model? Like not being able to detach users that are higher ranked than them, or specific to my example, detaching records that were attached from an administrative tenant.
6 replies
FFilament
Created by MarconiMamba on 10/19/2023 in #❓┊help
How to show more information in RelationManager Attach Search.
I have a RelationManager that allows users to Attach records from any of their authorized tenants. I would like to show the tenant name next to the line in the search box so the user knows they're attaching the record from the correct tenant. For example, if both tenants have records called "Corporate Department" I'd like the list in the search box to show as "Corporate Department (Tenant A), Corporate Department (Tenant B). I tried to use https://filamentphp.com/docs/3.x/panels/resources/relation-managers#searching-the-options-to-attach-across-multiple-columns but just got an error when i tried to use agency.name as one of my columns (as you would in the table builder).
10 replies
FFilament
Created by MarconiMamba on 10/13/2023 in #❓┊help
Admins access all tenants
Is there an easy way to give my 'super admin' role access to all tenants automatically? if I just go to the app side, if my admin login isn't attached to a tenant, I just get a 404, and have to attach to any tenant I want to view.
3 replies
FFilament
Created by MarconiMamba on 10/12/2023 in #❓┊help
Setting a default value to another value from the table.
I'm building a form in a relationManager and I am building a sort of version control where users can't directly edit an existing item, but they have to create a new one. I would like the 'content' field in the new item to default to the 'content' field of the most recent field (under the same parent model) so they can just make their changes and save, but then delete models to rollback to a certain version. I'm having trouble scoping out how to get that default value. (unless somebody has a better suggestion for versioning data like this)
4 replies
FFilament
Created by MarconiMamba on 10/10/2023 in #❓┊help
Going deeper on Tenant relationships
I'm trying to create a resource for a child of a resource that belongs to my tenant. But since the child resource doesn't have a direct relation to the tenant, when I try to view the list page, I'm getting an error as such. I'm likely missing something obvious, and don't know if this is a Filament question or general Laravel question. The error message:
The model [App\Models\Button] does not have a relationship named [agency]. You can change the relationship being used by passing it to the [ownershipRelationship] argument of the [tenant()] method in configuration. You can change the relationship being used per-resource by setting it as the [$tenantOwnershipRelationshipName] static property on the [App\Filament\App\Resources\ButtonResource] resource class.
The model [App\Models\Button] does not have a relationship named [agency]. You can change the relationship being used by passing it to the [ownershipRelationship] argument of the [tenant()] method in configuration. You can change the relationship being used per-resource by setting it as the [$tenantOwnershipRelationshipName] static property on the [App\Filament\App\Resources\ButtonResource] resource class.
Button BelongsTo ButtonGroup ButtonGroup BelongsTo Agency Agency is my Tenant I have tried and failed to add an
agency(): BelongsTo
agency(): BelongsTo
function into my Button model, but can't get one to work.
16 replies