nielsdscrd
nielsdscrd
FFilament
Created by nielsdscrd on 8/20/2023 in #❓┊help
Table actions on separate row - without split?
Thank you for the suggestion. I tried it just now. I would work if I could put some actions at the start, others at the end. With 4 actions at the start, people will not see what they're paying and still have to scroll horizontally. The Split solves the scrolling, but it messes up the layout, regardless of where I put the action buttons.
5 replies
FFilament
Created by Wannes on 8/7/2023 in #❓┊help
Hidden fields
Ah, apologies. I overlooked that.
7 replies
FFilament
Created by Wannes on 8/7/2023 in #❓┊help
Hidden fields
Was looking for the same. Ended up with this:
Section::make([
TextInput::make('username')
->label(__('Username')),
TextInput::make('password')
->label(__('Password'))
->formatStateUsing(function ($record) {
return $record->getPassword();
})->visible(fn(Get $get): bool => $get('reveal_password')),
Toggle::make('reveal_password')
->default(false)->live(),
])
Section::make([
TextInput::make('username')
->label(__('Username')),
TextInput::make('password')
->label(__('Password'))
->formatStateUsing(function ($record) {
return $record->getPassword();
})->visible(fn(Get $get): bool => $get('reveal_password')),
Toggle::make('reveal_password')
->default(false)->live(),
])
7 replies
FFilament
Created by StanProg on 8/7/2023 in #❓┊help
How to get currently logged user in AppPanelProvider?
In AppPanelProvider::panel() you are defining the middleware to be run, including authentication and sessions. Hence at that point the user cannot be known yet.
10 replies
FFilament
Created by Lara Zeus on 7/25/2023 in #❓┊help
adding trait Translatable will make all fields Translatable
Much like my own, this is a work-around, not a true fix. Replacing the incorrect data at the moment of Saving means the problem may pop up in other places as the actual cause is not resolved. It may be difficult for us to trace it back to the root, but hopefully @Dan Harrin or someone else with deeper knowledge of Filament can find the time to have look at this.
79 replies
FFilament
Created by Vladimir on 8/3/2023 in #❓┊help
Is there a thing like hot reload for Filament resources?
No description
41 replies
FFilament
Created by Vladimir on 8/3/2023 in #❓┊help
Is there a thing like hot reload for Filament resources?
Although Filament's documentation mentions that you should use @vite('resources/js/app.js') when using your own Livewire components, Filament itself does not seem to include this. Hence the Vite listener is invoked on your regular pages, but not Filament panels.
41 replies
FFilament
Created by Lara Zeus on 7/25/2023 in #❓┊help
adding trait Translatable will make all fields Translatable
php public function save(bool $shouldRedirect = true): void
{
$this->authorizeAccess();

$originalData = $this->data;
$originalActiveLocale = $this->activeLocale;

$nonTranslatableData = Arr::except($originalData[$originalActiveLocale], $this->record->getTranslatableAttributes());

try {
foreach ($this->getTranslatableLocales() as $locale) {
$this->setActiveLocale($locale);

// Merge the original non-translatable data into this locale's data
$this->data[$locale] = array_merge($this->data[$locale], $nonTranslatableData);

/** @internal Read the DocBlock above the following method. */
$this->validateFormAndUpdateRecordAndCallHooks();
}
} catch (Halt $exception) {
return;
}

$this->data = $originalData;
$this->setActiveLocale($originalActiveLocale);

/** @internal Read the DocBlock above the following method. */
$this->sendSavedNotificationAndRedirect(shouldRedirect: $shouldRedirect);
}
php public function save(bool $shouldRedirect = true): void
{
$this->authorizeAccess();

$originalData = $this->data;
$originalActiveLocale = $this->activeLocale;

$nonTranslatableData = Arr::except($originalData[$originalActiveLocale], $this->record->getTranslatableAttributes());

try {
foreach ($this->getTranslatableLocales() as $locale) {
$this->setActiveLocale($locale);

// Merge the original non-translatable data into this locale's data
$this->data[$locale] = array_merge($this->data[$locale], $nonTranslatableData);

/** @internal Read the DocBlock above the following method. */
$this->validateFormAndUpdateRecordAndCallHooks();
}
} catch (Halt $exception) {
return;
}

$this->data = $originalData;
$this->setActiveLocale($originalActiveLocale);

/** @internal Read the DocBlock above the following method. */
$this->sendSavedNotificationAndRedirect(shouldRedirect: $shouldRedirect);
}
79 replies
FFilament
Created by Lara Zeus on 7/25/2023 in #❓┊help
adding trait Translatable will make all fields Translatable
I use this modified save() function. It merges the correct data into every locale. I tried filtering out the data initially, but then validation may fail due to required fields.
79 replies
FFilament
Created by Lara Zeus on 7/25/2023 in #❓┊help
adding trait Translatable will make all fields Translatable
@larazeus just added my comment to your GitHub issue. I have the same issue. Initially all fields are updated in the database correctly. Then unexpected additional queries reset all non-translatable fields back to their original values.
79 replies
FFilament
Created by nielsdscrd on 7/27/2023 in #❓┊help
Show a NavigationItem to admins only
Re-tried with beta17 just now. Still the same.
11 replies
FFilament
Created by nielsdscrd on 7/27/2023 in #❓┊help
Show a NavigationItem to admins only
v3.0.0-beta10. The segfault can be fixed with this: https://github.com/livewire/livewire/pull/6008 (My error also occurs without this fix. In my case I hit the error prior to the other segfault error occurring).
11 replies
FFilament
Created by nielsdscrd on 7/27/2023 in #❓┊help
Show a NavigationItem to admins only
11 replies
FFilament
Created by nielsdscrd on 7/27/2023 in #❓┊help
Show a NavigationItem to admins only
I used this in a PanelProvider:
11 replies
FFilament
Created by nielsdscrd on 7/27/2023 in #❓┊help
Show a NavigationItem to admins only
Replacing the closure with a simple true or false avoids the error.
11 replies
FFilament
Created by nielsdscrd on 7/27/2023 in #❓┊help
Show a NavigationItem to admins only
Cannot assign Laravel\SerializableClosure\Serializers\Native to property Filament\Navigation\NavigationItem::$isVisible of type Closure|bool
11 replies
FFilament
Created by nielsdscrd on 7/3/2023 in #❓┊help
Items remain selected when filtered
That works. Not sure why I missed that one. Thanks! 👍
7 replies
FFilament
Created by nielsdscrd on 7/3/2023 in #❓┊help
Items remain selected when filtered
I don't want to clear the filters though. I want to clear the selected items.
7 replies