smartnathan
smartnathan
FFilament
Created by smartnathan on 5/16/2024 in #❓┊help
Spatie Translatable: Error upload image.
I've fixed, upload field doesn't have to be translatable, based on my findings
4 replies
FFilament
Created by smartnathan on 6/1/2024 in #❓┊help
Table row colorization
@Dennis Koch You are absolutely right, I used "bg-primary-600" and it worked. Please, where can I find all the default Filament classes. Thank you for your prompt response. I do appreciate.
5 replies
FFilament
Created by SETTINGS on 5/18/2024 in #❓┊help
ImportAction 10 thousand lines of csv
How about handling that as a Laravel Job, were you would have to queue the process.
4 replies
FFilament
Created by smartnathan on 5/18/2024 in #❓┊help
Repeater Calculate all quantity fields
I was able to get it solve after looking at the documentation. Below is my solution.
Forms\Components\Select::make('store_id')
->relationship('store', 'name')
->preload()
->searchable()
->required(),

Repeater::make('sales_items')->schema([
//The form products select and quantity textinput fields comes in here
])->live()
->afterStateUpdated(function (Get $get, Set $set) {
$total = 0;
$store_id = $get('store_id');
foreach ($get('sales_items') as $item) {
$product = StockAvailabilityStatus::where('product_id', $item['product_id'])->where('store_id', $store_id)->first();
if ($product && $item['quantity']) {
$total += $product->bulk_selling_price * $item['quantity'];
}
}
$set('formatted_total_amount', '₦' . number_format($total, 2));
})
Forms\Components\Select::make('store_id')
->relationship('store', 'name')
->preload()
->searchable()
->required(),

Repeater::make('sales_items')->schema([
//The form products select and quantity textinput fields comes in here
])->live()
->afterStateUpdated(function (Get $get, Set $set) {
$total = 0;
$store_id = $get('store_id');
foreach ($get('sales_items') as $item) {
$product = StockAvailabilityStatus::where('product_id', $item['product_id'])->where('store_id', $store_id)->first();
if ($product && $item['quantity']) {
$total += $product->bulk_selling_price * $item['quantity'];
}
}
$set('formatted_total_amount', '₦' . number_format($total, 2));
})
4 replies