Kyle
Kyle
FFilament
Created by Kyle on 7/30/2024 in #❓┊help
Get ID of parent model when making a child model using Relationship Manager via the modal
For example, when I am using a relationship manager to show the students inside a class. And the form editor for the class is currently showing the class edit form, and the students are shown in a table at the bottom of the page. There is a button in the table to create a new student, which will show a modal for creating the student. Fortunately, the class_id is automatically set when saving the student model, but I need the class_id for a different purpose. How do I get the parent class model (or at least its id property) so that I can use it in the dependency-injected functions? Thank you very much in advance.
3 replies
FFilament
Created by Kyle on 7/26/2024 in #❓┊help
Which Authentication and User Management plugin is recommended?
I see that there are several options for authentication in Filament and since I'm new to the ecosystem, I wanted to ask for your opinion and preferences. What option do you think is the closest to meeting my needs? Just asking for suggestions and tips, not necessarily hand-holding. I want to be able to: - Have 4 kinds of users, distinguished based on a field in their model - The developer (me) will control permissions of each kind of user using standard Laravel Policy feature (just changing via code is fine, no need to be able to control the permissions on the Filament panel) - The Laravel Policy will take effect in Filament panel, which will allow or prevent people from doing stuff based on their kind of user. - Admin user can view, delete, edit, and create more users and set what kind of user it will be What do you think is the most appropriate based on my needs? Thank you in advance!
3 replies
FFilament
Created by Kyle on 7/15/2024 in #❓┊help
FilePond seems to have a grid view feature. Is there any way to enable it in Filament?
Client is being annoying and wants the multiple images uploaded to be in a row instead of a column. FilePond seems to have a grid feature which is probably what the client wants but I can't seem to find how to enable it in Filament. Is there a hidden setting in Filament I can use?
8 replies
FFilament
Created by Kyle on 7/12/2024 in #❓┊help
How do I get the index of the current TextInput inside a simple Repeater?
I have a simple repeater, inside it is a TextInput. I just want to get the index of the current TextInput so that I can show it as the prefix. Maybe something like,
Repeater::make('scores')
->simple(
TextInput::make('score')
->prefix(fn ($index) => $index + 1)
->required()
)
Repeater::make('scores')
->simple(
TextInput::make('score')
->prefix(fn ($index) => $index + 1)
->required()
)
I tried my best to look everywhere on how I can do this but I just can't find an answer. I would be really grateful if anyone can give me hints to this... If it's impossible, please tell me so that I can try to find another way. Thank you very much in advance.
4 replies
FFilament
Created by Kyle on 6/5/2024 in #❓┊help
3rd Layer HasMany Relationship Manager doesn't show
No description
3 replies
FFilament
Created by Kyle on 6/5/2024 in #❓┊help
Show/Hide a field based on the value of another field THAT IS NOT IN DATABASE
So I've been reading the manual about the reactivity of forms, specially https://filamentphp.com/docs/3.x/forms/advanced#dynamic-fields-based-on-a-select-option . I understand how it works and I was also able to make it work, but currently, this requires that the select Field is an actual field in the database table. When I set the name to something that isn't in the table column, it throws an error. Is it possible to have the select field (or checkbox field) control the visibility of other fields, while not being actually in the database (just temporarily storing the data in Livewire or something)?
3 replies
FFilament
Created by Kyle on 6/5/2024 in #❓┊help
Best Way to Show Different HasMany Relations using Separate Tabs?
Hello, everyone! Apologies if my question is dumb but I can't find the right way to do this by reading the manual. Basically, I am creating a class management software for personal use. As a simple example, a Classroom has many Students, has activities and scores, and has different criteria for grading. In the main dashboard, I can choose the Classroom tab to show the list of registered Classrooms. But when I choose a classroom and the classroom's Edit page is shown with the basic classroom details ready to edit, I want to have separate tabs where the registered students, the activities, and the criteria can be listed and edited separately. What is the best way to achieve this effect in Filament? Thank you in advance for any suggestions. No spoonfeeding needed, I appreciate any clues and I'll do my best to research from there!
7 replies