Luiz
Luiz
FFilament
Created by Luiz on 10/28/2024 in #❓┊help
Actions\Action not calling the action method when combined with form
No description
2 replies
FFilament
Created by Luiz on 5/31/2024 in #❓┊help
How to hide relation manager only on view pages
I found how to hide it on edit pages, but I want to hide it only when using the view route
4 replies
FFilament
Created by Luiz on 5/14/2024 in #❓┊help
How to show brand logo when sidebar is collapsed on desktop?
No description
16 replies
FFilament
Created by Luiz on 4/9/2024 in #❓┊help
Is possible to add pooling to an infolist or a Page?
I built a page the represent a list of services running related to a resource. So from time to time I need it to refresh
4 replies
FFilament
Created by Luiz on 3/14/2024 in #❓┊help
Is possible to create page with dynamic sub pages?
I want to create a page with a list that works like google drive. In this page there are files to download or a folder to access more files. How can I create a with the page builder with this kind of dynamic url? Route examples
1. folders/
2. folders/{folder}/
3. folders/{folder}/{subfolder}
1. folders/
2. folders/{folder}/
3. folders/{folder}/{subfolder}
3 replies
FFilament
Created by Luiz on 2/6/2024 in #❓┊help
How to only allow TagsInput to use tags from suggestion?
I want to stop user from creating tags on the fly and allow use the suggested values
6 replies
FFilament
Created by Luiz on 1/22/2024 in #❓┊help
Custom page with custom permissions
I created a custom page and now I need to block this page access using the spatie permission package. But I did not find where I can block this page navigation nor hide it from the navigation menu like resources. I explored the source and didn't see any reference to this functionality
4 replies
FFilament
Created by Luiz on 11/22/2023 in #❓┊help
Form Tabs not saving the correct relationship content.
So I have a form that has an Tab that handles the translation of some fields, like title and description of a model. What is happening is that for now the app has 3 basic languages, more will be add later. To make this possible every translatable model has an i18n table counterpart. This i18n has one column per translatable property of the model together with the composite primary key model_id and locale, here is an example:
Table public.models
- id [pk]
- status
- created_at
- updated_at

Table i18n.models
- model_id [pk] [fk public.models.id]
- locale [pk]
- title
- description
Table public.models
- id [pk]
- status
- created_at
- updated_at

Table i18n.models
- model_id [pk] [fk public.models.id]
- locale [pk]
- title
- description
The example above shows that Model will not have title and description fields. It will be saved on the i18n one with their respective locale, en_CA, fr_CA and etc. I built and trait that helps getting the correct model with above structure. Trait What happens is that the correct values are shown, but when I press the save button, the current visible Tab overwrites all others locales. So if a save when en_CA tab is visible, the tab holding the values for fr_CA will be overwritten. Here is an simplified code of how Tabs was built:
class ExampleResource extends Resource
{
public static function form(Form $form): Form
{
return $form
->schema([
Section::make('Core information')
->schema([
Tabs::make()
->tabs([
static::createLanguageTab('en_CA'),
static::createLanguageTab('fr_CA'),
]),
]),
]);
}

private static function createLanguageTab($locale): Tabs\Tab
{
return Tab::make($locale)
->schema([
Group::make()
/** this will call the magic methods `intlEnCA` and `intlFrCA` */
->relationship('intl' . ucfirst(preg_replace('/_/', '', $locale)))
->schema([
/** Necessary to create a new row */
Components\Hidden::make('locale')->default($locale),
Components\TextInput::make('title')->label('Title'),
Components\TextInput::make('description')->label('description'),
]),
]);
}
}
class ExampleResource extends Resource
{
public static function form(Form $form): Form
{
return $form
->schema([
Section::make('Core information')
->schema([
Tabs::make()
->tabs([
static::createLanguageTab('en_CA'),
static::createLanguageTab('fr_CA'),
]),
]),
]);
}

private static function createLanguageTab($locale): Tabs\Tab
{
return Tab::make($locale)
->schema([
Group::make()
/** this will call the magic methods `intlEnCA` and `intlFrCA` */
->relationship('intl' . ucfirst(preg_replace('/_/', '', $locale)))
->schema([
/** Necessary to create a new row */
Components\Hidden::make('locale')->default($locale),
Components\TextInput::make('title')->label('Title'),
Components\TextInput::make('description')->label('description'),
]),
]);
}
}
2 replies