Diogo Pinto
Import action - fill relationship hasone
Hey all,
I'm trying to import a CSV that has a price relationship (hasOne). This is how I'm trying to do it:
Thing is, obviously, the $record->price can't be created because the record hasn't been assigned an ID yet.
How can I approach this? Is it even possible with the Import action?
2 replies
modifyQueryUsing based on request - action resets query
Hey all,
Use case:
- In the /view it gets all categories that don't have parent ids
- When you click on a record it takes you to route /{record}/view
- In /{record}/view it fetches all subcategories where parent_id = {record}
Problem:
- In /{record}/view when I click on a Table action, the query resets and the action doesn't perform.
Here's the code:
I'm wondering if I'm doing anything wrong or approaching the wrong way.
Thanks!
8 replies
Adding relationship manager to livewire
Hello all,
Is there a painless way to add a Relationship Manager to a custom livewire component?
Use cases:
- A edit profile page with an address (belongstomany) relationship - user can attach and detach addresses
Thanks!
6 replies
Action shows view with nested actions?
Hey guys, how are you?
How would you approach creating an action that is a livewire component by itself? Meaning, that when you click it renders a dynamic view with actions nested?
I've used:
this returns an array, and in the blade file I user a foreach... but I want to be able to click an array item and when I click it, it renders a modal with something.
Thank you so much!
8 replies
SelectFilter relationship field
Hello all,
I have a users table, with a relation (HasOne) user_meta table. So the relationship is:
$user->meta->professional_category
That returns the professional category of the user.
So, why doesn't this filter work?
The output:
I don't know what I'm doing wrong. Must I run the query directly?
6 replies
Textinput suffix icon color
Hello all,
I'm wondering if there is any way to add a color to the suffix icon on my input.
Use case:
An action validates a country code, if the country code is true it affixes the valid icon:
`
I'm wondering if there is a way to add a color to the suffixIcon.
Thank you!
2 replies
User Set Password after registering User in the panel
Hello all,
I'm building a user resource that enables Admins to register users manually.
When an action is toggled to enable the login, the action triggers the Email Verification process:
Now what I would like to achieve is to enable the user to set a password when he clicks the verify email.
What would be your approach? I don't think fillament has anything under the hood ready for this after looking at the docs, but I may be wrong!
Thank you!
15 replies
Decimal separator to comma instead of dot
Hey all,
In my country we use comma as a decimal separator instead of a dot. So I would like to ask: how to change de price display/input to get and set with a comma as a decimal separator?
Doing this on a resource level with masks for input transformation seem like an overkill.
Thanks!
9 replies
Model with different layout based on category
Hello all,
I would like your help on how to achieve this logically taking in account good coding principles, indexing and performance issues.
Imagine the following:
- A model of "Books"
- Books can have different "Categories"
- When creating a Book:
-- If category is Fiction shows fields A, B and C
-- If category is Non-Fiction shows fields D, E, F
My questions:
- How should I store that data?
-- Should I have all those fields in the database and leave empty depending on category
-- Or should i just have a "meta" column and store it as JSON?
- How would I show each field set based on category selected?
Thank you. I'm new to filament and before getting hands on I'm trying to write all the logic behind this.
Thanks!
5 replies