Raven
Raven
FFilament
Created by Raven on 12/2/2024 in #❓┊help
help with repeaters and updating data pls
Gotcha. Thank you!
25 replies
FFilament
Created by Raven on 12/2/2024 in #❓┊help
help with repeaters and updating data pls
No description
25 replies
FFilament
Created by Raven on 12/2/2024 in #❓┊help
help with repeaters and updating data pls
The max value field is quantity, so it's disabled as well, yes.
25 replies
FFilament
Created by Raven on 12/2/2024 in #❓┊help
help with repeaters and updating data pls
@toeknee I've got this and it works. However, using $get I find is a bit icky because someone can change the value of name in developer tools to be ANOTHER item's name and it'd update the max value allowed for received quantity, no?
25 replies
FFilament
Created by Raven on 12/2/2024 in #❓┊help
help with repeaters and updating data pls
TextInput::make('received_quantity')->required()->numeric()->minValue(0)->maxValue(fn (
VendorInvoice $record,
Get $get
) => collect($record->purchaseOrder->items)->firstWhere('name',
$get('name'))['quantity'])->label('Received Quantity')
TextInput::make('received_quantity')->required()->numeric()->minValue(0)->maxValue(fn (
VendorInvoice $record,
Get $get
) => collect($record->purchaseOrder->items)->firstWhere('name',
$get('name'))['quantity'])->label('Received Quantity')
25 replies
FFilament
Created by Raven on 12/2/2024 in #❓┊help
help with repeaters and updating data pls
The received quantity for "Box, Medium" CANNOT be higher than its quantity, which is 10. So, if I put 11, it should error. For the packing tape, it cannot be 3, since the max quantity for that one is 2.
25 replies
FFilament
Created by Raven on 12/2/2024 in #❓┊help
help with repeaters and updating data pls
[{"name":"Box, Medium","quantity":"10","unit_cost":"200","tax_rate":"5","received_quantity":"6"},{"name":"Packing Tape","quantity":"2","unit_cost":"500","tax_rate":"5","received_quantity":"0"}]
[{"name":"Box, Medium","quantity":"10","unit_cost":"200","tax_rate":"5","received_quantity":"6"},{"name":"Packing Tape","quantity":"2","unit_cost":"500","tax_rate":"5","received_quantity":"0"}]
This is what that looks like in the database.
25 replies
FFilament
Created by Raven on 12/2/2024 in #❓┊help
help with repeaters and updating data pls
No description
25 replies
FFilament
Created by Raven on 12/2/2024 in #❓┊help
help with repeaters and updating data pls
I need to grab the max value from the quantity field in the repeater for that respective item.
25 replies
FFilament
Created by Raven on 12/2/2024 in #❓┊help
help with repeaters and updating data pls
Well, I don't know the quantity in the code.
25 replies
FFilament
Created by Raven on 12/2/2024 in #❓┊help
help with repeaters and updating data pls
Oh, perfect then, thank you! Also, do you know how to make it so that one of the fields (received quantity) can only have a max of the quantity number? So, I've got multiple items in the repeater, and for one of the items the quantity is 10 for example, the received quantity cannot be higher than 10. I don't know how to do that.
25 replies
FFilament
Created by Raven on 12/2/2024 in #❓┊help
help with repeaters and updating data pls
https://filamentphp.com/docs/3.x/forms/advanced#field-dehydration
Dehydration is the process that gets data from the fields in your forms, and transforms it.
Yea, I'm going to test it in a bit but I think it would have a little bit of a vulnerability there. It doesn't really pose much of an security issue, per se. Just user experience.
25 replies
FFilament
Created by Raven on 12/2/2024 in #❓┊help
help with repeaters and updating data pls
Wouldn't that allow users to possibly edit the input in the developer tools still? That's why I want dehydrated(false).
25 replies
FFilament
Created by Raven on 12/1/2024 in #❓┊help
How do I generate a random reference?
Perfect, thank you!
10 replies
FFilament
Created by Raven on 12/1/2024 in #❓┊help
How do I generate a random reference?
Basically, I want it to suggest INV-0001 and the user can change it if need be.
10 replies
FFilament
Created by Raven on 12/1/2024 in #❓┊help
How do I generate a random reference?
That's not what I want to happen tho. I want the form to by default fill with something like INV-0001 and then the user can change it in the form.
10 replies
FFilament
Created by Raven on 12/1/2024 in #❓┊help
Reactive Fields
Select::make('purchase_order_id')->relationship('purchaseOrder',
'reference')->preload()->searchable()->native(false)->label('Purchase Order'),
Select::make('vendor_id')->relationship('vendor',
'name')->preload()->searchable()->native(false)->required()->label('Vendor'),
Select::make('purchase_order_id')->relationship('purchaseOrder',
'reference')->preload()->searchable()->native(false)->label('Purchase Order'),
Select::make('vendor_id')->relationship('vendor',
'name')->preload()->searchable()->native(false)->required()->label('Vendor'),
6 replies
FFilament
Created by Raven on 11/30/2024 in #❓┊help
How do I integrate `moneyphp/money` with text inputs and columns?
5 replies
FFilament
Created by Raven on 11/30/2024 in #❓┊help
How do I integrate `moneyphp/money` with text inputs and columns?
I found a Filament plugin that's a drop-in replacement for all money fields and it worked amazingly. Thank you!
5 replies
FFilament
Created by Raven on 11/30/2024 in #❓┊help
What's a better way to handle this?
Smart, thank you!
5 replies