pratik
Relationship with a relationship after create?
I just got an idea while typing this, i can create a due hidden field, then I can use dehydrateStateusing and do my calculations there and customize the creation process to record the due. ? does this sound good ?
21 replies
Relationship with a relationship after create?
I am creating a new purchase, purchase has many payments that is being created with purchase using repeater. Then I need to access the total paid amount i.e sum of amount from multiple payments records and subtract it from total purchase amount to calculate due. My goal is to record this due amount in payments_due table. Using observer hasn't been much help as the payments is not created when purchase created event is fired.
21 replies
Undefined array key name despite having validation
I remember that it was to return the $customer->id back to the select and get the newly created customer selected . The default wasn't working.
By working I mean, the customer name wasn't showing up as selected in select field and it was empty.
I removed this extra bit of code from the original message due to character limitation.
3 replies
Can I create something like this in filament
@Adnan Yalahow Filament way is the TALL way. create custom filament page with custom view, Create blade components, use tailwind for styles, use Filament Modals, Filament actions and sprinkle some livewire and alpinejs.
Here are some useful blade components mentioned in the documentation : https://filamentphp.com/docs/3.x/support/blade-components/overview
4 replies
Create Policies for each Auth Model (Multi Panels)
If you are trying to achieve different polices for different panels you can do something like this in AuthServiceProvider:
Suppose you have two panel providers, AdminPanelProvider and CustomerPanelProvider, To use this implementation, you should have Admin related Models in App\Models\Admin directory and Customer related models in App\Models\Customer directory.
Also, Admin related policies in App\Policies\Admin and Customer related policies in App\Policies\Customer directory. The directory name is based on Panel's id.
5 replies
File (image) upload preview as grid
@Vitali Kartsivadze https://filamentphp.com/docs/3.x/forms/fields/file-upload#altering-the-appearance-of-the-file-upload-area
6 replies
Error when select data with afterstateupdated
There is no selected product ($state is null) after you clear the select field, what are you trying to achieve when no product is selected ?
you can just check if the $state is not null and wrap the logic in the condition.
11 replies
Modal Footer
I think one way to do this is by using the custom view : https://filamentphp.com/docs/3.x/actions/modals#adding-custom-modal-content-below-the-form
3 replies