AaronFarm
Repeater with 2 Unique Key Combinations
Good morning, I have a case where a course has a cost based on a "mode" and "type". Initially, it was based only on the "mode", and this code in
CourseResource
worked perfectly:
But after adding the "type", I get errors when saving, errors when disabling the selects for the unique combination of types and modes, etc.
My question is: Is there an established or standard way to handle the Repeater with 2 unique key combinations?
Before:
courses(id, name)
modes(id, name)
costs(id, [course_id, mode_id] unique, cost)
Now:
courses(id, name)
modes(id, name)
types(id, name)
costs(id, [course_id, mode_id, type_id] unique, cost)
4 replies
Remove routes for modals or use --simple?
Good afternoon, I have a question. To create a simple resource with modals, I know that you use
php artisan make:filament-resource Customer --simple
, but initially, I created the resource with the default pages for edit and create. Now I realize that I actually wanted a modal and did the following: removed the routes:
Now they are modals, but my question is: is this approach really okay? Would there be any issues with this method, or should I use --simple
? I noticed that --simple
creates a slightly different structure, only creating a management page in the resources folder.3 replies
Custom Toggle
Is it possible to obtain the current record and the state of the toggle, true or false, in order to perform operations when saving or updating the form, so that based on that record and toggle state, custom operations can be performed, such as creating or editing other different models and the database?
Forms\Components\Toggle::make('custom'),
7 replies