electronick86
electronick86
FFilament
Created by electronick86 on 6/3/2024 in #❓┊help
VAT calculation
Hello, I woud like to make two field reactive but on client side. On an application I'm moving to Filament v3, I need to have two fields: price_excl_vatand price_incl_vat . I agree that is not the bast way to store the information as there is a field vat_rate. When the user fill the field price_excl_vat the other field should be calculated based on the vat_rate, and if the user types into the price_incl_vat field, it should also calculate the exclusive vat price. This was done in javscript in the legacy application. I needs to replicate that. Using the ->live()->afterStateUpdated() method don't seems to works, if the connection is slow you miss some typed characters. Could I replicate this in javascript/AlpinJs) on my Resource Form? I first though that ViewField could helps but I need a global alipine js component to hold the logic that interracts with several fields. Do you have some ideas? Thanks in advance!
6 replies
FFilament
Created by electronick86 on 2/25/2024 in #❓┊help
Modal issue when using Render Hook PAGE_START
Hello. When I use the Render Hook PAGE_START like this :
FilamentView::registerRenderHook(
PanelsRenderHook::PAGE_START,
fn (): View => view('filament.user-profile.warning-unverified-number-banner'),
scopes: [
PrivateVehicleResource::class,
EditProfile::class
],
);
FilamentView::registerRenderHook(
PanelsRenderHook::PAGE_START,
fn (): View => view('filament.user-profile.warning-unverified-number-banner'),
scopes: [
PrivateVehicleResource::class,
EditProfile::class
],
);
My application don't have modals anymore. Just commenting this render hook makes the modals working again. If I comment everything in my view (filament.user-profile.warning-unverified-number-banner), the problem remains the same. Am I doing something wrong?
2 replies
FFilament
Created by electronick86 on 2/9/2024 in #❓┊help
Download exported files with custom middlware
Hello. I just try to use the exporter on an application having specific authentification mecanism. I'm not authenticated when I download the exported CSV because I have wrong middlwares here :
Route::get('/filament/exports/{export}/download', DownloadExport::class)
->name('filament.exports.download')
->middleware(['web', 'auth']);

Route::get('/filament/imports/{import}/failed-rows/download', DownloadImportFailureCsv::class)
->name('filament.imports.failed-rows.download')
->middleware(['web', 'auth']);
Route::get('/filament/exports/{export}/download', DownloadExport::class)
->name('filament.exports.download')
->middleware(['web', 'auth']);

Route::get('/filament/imports/{import}/failed-rows/download', DownloadImportFailureCsv::class)
->name('filament.imports.failed-rows.download')
->middleware(['web', 'auth']);
Would it be possible to use another middleware than web and auth?
3 replies
FFilament
Created by electronick86 on 9/25/2023 in #❓┊help
Don't stay connected unless "remember me"
Hello. My application use a custom guard but I want to use the standard session guard with filament. My config/auth.php contains :
'guards' => [
'web' => [
'driver' => 'jwt',
'provider' => 'users',
],

'web-session' => [
'driver' => 'session',
'provider' => 'users',
],


],
'guards' => [
'web' => [
'driver' => 'jwt',
'provider' => 'users',
],

'web-session' => [
'driver' => 'session',
'provider' => 'users',
],


],
My adminPanelProvider is set to a custom guard ->authGuard('web-session');. Everything works if I check the "remember me" checkbox. However, I can't login if the "remember me" is not check. I can't figure out why. Do you have any idea? Many thanks in advance for you help!
2 replies