Xavi
Xavi
FFilament
Created by Xavi on 6/19/2024 in #❓┊help
Best folder structure
What is the best folder structure for this scenario? We need a page to display wallet transactions (movements) and invoices. This page must include two Livewire components: one to show transactions and another to show invoices. These components will be included in separate tabs. I propose creating a Wallet Page with tabs inside Pages/Wallet. Inside it, we can create a folder called Pages/Wallet/Components to house the two Livewire components. Is this the best folder structure?
2 replies
FFilament
Created by Xavi on 6/13/2024 in #❓┊help
Custom column classes
I create a custom column, but tailwind doesn't compile css classes inside it. I try add on tailwind.config.js this line on content
' './resources/views/tables/**/*.blade.php'
' './resources/views/tables/**/*.blade.php'
but it doesn't works. Any suggestions? Thanks a lot
4 replies
FFilament
Created by Xavi on 6/12/2024 in #❓┊help
Remove "remove item" on select
How can i hide/remove cross from select when its not native. I don't want that users can remove selected option (he must change it) Thanks
5 replies
FFilament
Created by Xavi on 6/12/2024 in #❓┊help
Select: Width after selected
How can i keep width after option is selected on select field? Now when i click on a small option, select width makes small and i want to keep same width all time Thanks
2 replies
FFilament
Created by Xavi on 6/11/2024 in #❓┊help
How to apply CSS to sidebar navigation group
Hi everyone! I want to apply CSS to only one navigation group, but it doesn't works. For example if i want to hide navigation group label for a menu called "First Menu" i add this code
.fi-sidebar-group [data-group-label="First Menu"] > div:first-child {
@apply hidden
}
.fi-sidebar-group [data-group-label="First Menu"] > div:first-child {
@apply hidden
}
but it doesn't works. Any ideas? Thanks a lot!
7 replies
FFilament
Created by Xavi on 6/10/2024 in #❓┊help
Hide wizard steps
No description
2 replies
FFilament
Created by Xavi on 5/29/2024 in #❓┊help
Create a custom field with two fields (downloadable)
How can i create a custom field that contains a field for title and a upload field to use inside as a builder block. How can i do? There are documentation about it? Thanks
3 replies
FFilament
Created by Xavi on 5/20/2024 in #❓┊help
Get value from another Grid relationship
How can i get link_in_published value that its on another grid (relationship)? this is my code
Grid::make()
->columns(2)
->schema([
Grid::make()
->columns(1)
->relationship('options')
->schema([
Checkbox::make('link_in_published')
->label(__('Aceptan enlace en artículo publicado'))
->live(),
]),
Grid::make()
->columns(1)
->relationship('prices')
->schema([
TextInput::make('cost_price_link_in_published')
->label(__('Precio de enlace en artículo publicado'))
->reactive()
->visible(fn(Get $get) => $get('link_in_published'))
->required(fn(Get $get): bool => $get('link_in_published')),
]),
]),
Grid::make()
->columns(2)
->schema([
Grid::make()
->columns(1)
->relationship('options')
->schema([
Checkbox::make('link_in_published')
->label(__('Aceptan enlace en artículo publicado'))
->live(),
]),
Grid::make()
->columns(1)
->relationship('prices')
->schema([
TextInput::make('cost_price_link_in_published')
->label(__('Precio de enlace en artículo publicado'))
->reactive()
->visible(fn(Get $get) => $get('link_in_published'))
->required(fn(Get $get): bool => $get('link_in_published')),
]),
]),
Thanks!
2 replies
FFilament
Created by Xavi on 5/17/2024 in #❓┊help
TagsInput belongsToMany
How can i set the TagsInput value on edit form, if values are a belongsToMany relationship i try something like this, but it doesn't works

->loadStateFromRelationshipsUsing(function ($record) {
return $record->keywords()->where('manual', true)->pluck('name')->toArray();
})

->loadStateFromRelationshipsUsing(function ($record) {
return $record->keywords()->where('manual', true)->pluck('name')->toArray();
})
Thanks
7 replies
FFilament
Created by Xavi on 5/15/2024 in #❓┊help
Custom attribute searchable
Hello! Is it possible to make custom model attribute searchable on table search? Thanks!
8 replies
FFilament
Created by Xavi on 5/13/2024 in #❓┊help
Reuse custom column view
Is It possible to reuse custom column view on a livewire component? I have a column that shows spam level for a domain, and i want to reuse it on view livewire component. But custom column uses getRecord() to access Model, and i don't know what i must send to view component to works Thanks
3 replies
FFilament
Created by Xavi on 4/22/2024 in #❓┊help
ImportAction on suffixAction
How can i add ImportAction on TextInput SuffixAction? If i add as i know it throws error: Filament\Forms\Components\TextInput::suffixAction(): Argument #1 ($action) must be of type Filament\Forms\Components\Actions\Action|Closure, Filament\Actions\ImportAction given Thanks!
4 replies
FFilament
Created by Xavi on 4/20/2024 in #❓┊help
TextInput multiple relations
I have this code
return $form
->schema([
Section::make()
->schema([
Grid::make()
->schema([
Group::make()
->relationship('header')
->schema([
TextInput::make('email')
->formatStateUsing(function ($record) {
return $record->user->email;
})
->label(__('Cliente'))
->disabled(),
]),
Group::make()
->relationship('campaign')
->schema([
TextInput::make('description')
->formatStateUsing(function ($record) {
return $record->description;
})
->label(__('Campaña'))
->disabled(),
]),
])->columns(2),
Grid::make()
->relationship('header')
->schema([
TextInput::make('url')
->label(__('URL'))
->disabled(),
])->columns(1),

])
]);
return $form
->schema([
Section::make()
->schema([
Grid::make()
->schema([
Group::make()
->relationship('header')
->schema([
TextInput::make('email')
->formatStateUsing(function ($record) {
return $record->user->email;
})
->label(__('Cliente'))
->disabled(),
]),
Group::make()
->relationship('campaign')
->schema([
TextInput::make('description')
->formatStateUsing(function ($record) {
return $record->description;
})
->label(__('Campaña'))
->disabled(),
]),
])->columns(2),
Grid::make()
->relationship('header')
->schema([
TextInput::make('url')
->label(__('URL'))
->disabled(),
])->columns(1),

])
]);
Email field doesn't show content, but if i remove URL, email its showed. Both of fields its a relationship I don't know how to fix it. Thanks!!!
9 replies
FFilament
Created by Xavi on 3/20/2024 in #❓┊help
How can i make a selectfilter live()?
I want to make selectfilter live (reactive) but i can't do it. I want to make a filter dependant (Country -> Region). How can i do this? Thanks
3 replies
FFilament
Created by Xavi on 3/15/2024 in #❓┊help
Another button on modal filter
Hello It's possible to add another button on table filter to show/hide some group of filters? For example, i have a form with default filters, and i want to create a button to hide default filters and show advanced filters Thank you so much!
6 replies
FFilament
Created by Xavi on 2/15/2024 in #❓┊help
How to set selected on edit form
I have this field
Forms\Components\Select::make('billing')
->label(__('Datos de facturación'))
->options(function (RelationManager $livewire): array {
return $livewire->ownerRecord->billings
->pluck('name', 'id')
->toArray();
})
->searchable()
->required()
Forms\Components\Select::make('billing')
->label(__('Datos de facturación'))
->options(function (RelationManager $livewire): array {
return $livewire->ownerRecord->billings
->pluck('name', 'id')
->toArray();
})
->searchable()
->required()
How can i set selected value on edit form (its a relationmanager), searching on user_billings table?? I try adding this
->formatStateUsing(function (UserInvoice $record, RelationManager $livewire): ?int {
return $livewire->ownerRecord->billings->where('nif', $livewire->ownerRecord->nif)->first()?->id;
})
->formatStateUsing(function (UserInvoice $record, RelationManager $livewire): ?int {
return $livewire->ownerRecord->billings->where('nif', $livewire->ownerRecord->nif)->first()?->id;
})
But it doesn't works Thanks
6 replies
FFilament
Created by Xavi on 1/25/2024 in #❓┊help
Model observer doesn't works on relation manager
I have a created observer function on a model but on Relation Manager inside resource, it doesn't fired when i create a new relation. It may be possible? Thanks
3 replies
FFilament
Created by Xavi on 1/24/2024 in #❓┊help
Relationship Manager doesn't show
No description
5 replies
FFilament
Created by Xavi on 1/24/2024 in #❓┊help
Refresh field after modal form
I want to refresh field after modal form, but i don't know how? Anyone can helpme? Its my code:
TextInput::make('deposit')
->label(__('Saldo'))
->formatStateUsing(fn(User $user) => $user->getWallet()->balance)
->disabled()
->suffixAction(
Action::make('updateDeposit')
->label(__('Actualizar saldo'))
->icon('heroicon-m-clipboard')
->form([
TextInput::make('amount')
->label(__('Cantidad'))
->required()
->numeric(),
TextInput::make('description')
->required()
->label(__('Descripción'))
])
->action(function ($action, array $data, User $record): void {
$walletService = new WalletService($record);

if ($data['amount'] > 0) {
$walletService->deposit($data['amount'], $data['amount']);
}

if ($data['amount'] < 0) {
$walletService->withdraw($data['amount'], -$data['amount']);
}

Notification::make()
->title(__('Saldo actualizado'))
->body(__('El saldo se ha actualizado correctamente'))
->send();
})

),
TextInput::make('deposit')
->label(__('Saldo'))
->formatStateUsing(fn(User $user) => $user->getWallet()->balance)
->disabled()
->suffixAction(
Action::make('updateDeposit')
->label(__('Actualizar saldo'))
->icon('heroicon-m-clipboard')
->form([
TextInput::make('amount')
->label(__('Cantidad'))
->required()
->numeric(),
TextInput::make('description')
->required()
->label(__('Descripción'))
])
->action(function ($action, array $data, User $record): void {
$walletService = new WalletService($record);

if ($data['amount'] > 0) {
$walletService->deposit($data['amount'], $data['amount']);
}

if ($data['amount'] < 0) {
$walletService->withdraw($data['amount'], -$data['amount']);
}

Notification::make()
->title(__('Saldo actualizado'))
->body(__('El saldo se ha actualizado correctamente'))
->send();
})

),
Thanks
6 replies
FFilament
Created by Xavi on 12/27/2023 in #❓┊help
Advanced filters
Hello Is it possible to make advaced filters like image atttached?. I want than when user clicks to SEO Filters button its show more filters, but before it remains hide Thanks
3 replies