zainalab
zainalab
FFilament
Created by zainalab on 3/4/2024 in #❓┊help
Dynamic form for product prices
there are still new problems here. If there is an additional License. then the new license does not appear on the repeater page edit.. do you have a solution?
4 replies
FFilament
Created by zainalab on 3/4/2024 in #❓┊help
Dynamic form for product prices
I have a solution, but this worked for me. If yes, please fix it..
Forms\Components\Repeater::make('productPrices')
->relationship()
->schema([
Forms\Components\Hidden::make('license_id'),
Forms\Components\TextInput::make('price')
->numeric()
])
->deletable(false)
->collapsible()
->addable(false)
->itemLabel(fn (array $state): ?string => License::find($state['license_id'])->name ?? null)
->formatStateUsing(function(Livewire $livewire, $state) {
if ($livewire instanceof Pages\EditProduct && ! blank($state)) {
return $state;
}

return collect(License::all())
->map(fn($license) => ['license_id' => $license->id])
->toArray();
})
Forms\Components\Repeater::make('productPrices')
->relationship()
->schema([
Forms\Components\Hidden::make('license_id'),
Forms\Components\TextInput::make('price')
->numeric()
])
->deletable(false)
->collapsible()
->addable(false)
->itemLabel(fn (array $state): ?string => License::find($state['license_id'])->name ?? null)
->formatStateUsing(function(Livewire $livewire, $state) {
if ($livewire instanceof Pages\EditProduct && ! blank($state)) {
return $state;
}

return collect(License::all())
->map(fn($license) => ['license_id' => $license->id])
->toArray();
})
4 replies
FFilament
Created by zainalab on 8/11/2023 in #❓┊help
In Mode Dark, Select Option not dark
okey thanks bro
6 replies
FFilament
Created by captaincavemonkey on 7/23/2023 in #❓┊help
Call to a member function auth() on null
manual register \App\Providers\Filament\AdminPanelProvider::class to config/app.php
10 replies
FFilament
Created by zainalab on 5/3/2023 in #❓┊help
I need appropriate to always show modal
okay, thanks, maybe redirecting to a specific page would be a solution and more secure
6 replies
FFilament
Created by zainalab on 5/3/2023 in #❓┊help
I need appropriate to always show modal
maybe..
6 replies
FFilament
Created by zainalab on 4/7/2023 in #❓┊help
Fail, Upload zip file
for best practice should use all of these application/zip, application/octet-stream, multipart/x-zip, application/zip-compressed, application/x-zip-compressed, application/x-zip ?
20 replies
FFilament
Created by zainalab on 4/7/2023 in #❓┊help
Fail, Upload zip file
I use windows, chrome and app laragon
20 replies
FFilament
Created by zainalab on 4/7/2023 in #❓┊help
Fail, Upload zip file
thanks bro 👍
20 replies
FFilament
Created by zainalab on 4/7/2023 in #❓┊help
Fail, Upload zip file
work broo.. 👍 mime type returned application/x-zip-compressed and i have used acceptedFileTypes(['application/x-zip-compressed'])
20 replies
FFilament
Created by zainalab on 4/7/2023 in #❓┊help
Fail, Upload zip file
I use filament form builder Forms\Components\FileUpload::make('file')->acceptedFileTypes(['application/zip']) https://filamentphp.com/docs/2.x/forms/fields#file-upload
20 replies
FFilament
Created by zainalab on 4/7/2023 in #❓┊help
Fail, Upload zip file
20 replies
FFilament
Created by zainalab on 4/7/2023 in #❓┊help
Fail, Upload zip file
20 replies
FFilament
Created by zainalab on 4/7/2023 in #❓┊help
Fail, Upload zip file
i have checked using mime_content_type the result is application/zip
20 replies
FFilament
Created by zainalab on 4/7/2023 in #❓┊help
Fail, Upload zip file
I've used a lot of random zip files and the result is always the same.
20 replies
FFilament
Created by zainalab on 4/6/2023 in #❓┊help
How can i show modal on all admin pages?
6 replies
FFilament
Created by zainalab on 4/6/2023 in #❓┊help
How can i show modal on all admin pages?
Please help me
6 replies