Wannes
Wannes
FFilament
Created by Wannes on 8/28/2024 in #❓┊help
Mount action after another action
Hi, Is it possible to open a new action form when pressing "Send" on the first one? After I sign a document via a modal, a popup should display to send an email. Yet I cant figure out how to do this, this is as far as I get, the second modal opens, but closes a second after.
SignAction::make('signTeamLead')
->arguments([
'prefix' => 'team_leader',
])
->label(__('resources/startup-sheets.sign_team_lead'))
->after(function ($livewire) {

$this->unmountAction();

$this->mountAction('sendStartupSheetMail');

}),
SignAction::make('signTeamLead')
->arguments([
'prefix' => 'team_leader',
])
->label(__('resources/startup-sheets.sign_team_lead'))
->after(function ($livewire) {

$this->unmountAction();

$this->mountAction('sendStartupSheetMail');

}),
5 replies
FFilament
Created by Wannes on 5/7/2024 in #❓┊help
Togglebuttons selects everything
Hi there! If I select one item in my ToggleButtons form component, for some weird reason it selects them all. Has anyone else experienced this issue?
ToggleButtons::make('days')
->label(__('integrations.track_and_trace.days_label'))
->live()
->grouped()
->options([
'monday' => __('integrations.track_and_trace.days.monday'),
'tuesday' => __('integrations.track_and_trace.days.tuesday'),
'wednesday' => __('integrations.track_and_trace.days.wednesday'),
'thursday' => __('integrations.track_and_trace.days.thursday'),
'friday' => __('integrations.track_and_trace.days.friday'),
'saturday' => __('integrations.track_and_trace.days.saturday'),
'sunday' => __('integrations.track_and_trace.days.sunday'),
])
ToggleButtons::make('days')
->label(__('integrations.track_and_trace.days_label'))
->live()
->grouped()
->options([
'monday' => __('integrations.track_and_trace.days.monday'),
'tuesday' => __('integrations.track_and_trace.days.tuesday'),
'wednesday' => __('integrations.track_and_trace.days.wednesday'),
'thursday' => __('integrations.track_and_trace.days.thursday'),
'friday' => __('integrations.track_and_trace.days.friday'),
'saturday' => __('integrations.track_and_trace.days.saturday'),
'sunday' => __('integrations.track_and_trace.days.sunday'),
])
22 replies
FFilament
Created by Wannes on 4/29/2024 in #❓┊help
Persist selectable items after search action
Hi there! When we select records, and than we search to select another record our 'selectable array' resets. Is there a possibility to store the selected items in a table?
4 replies
FFilament
Created by Wannes on 4/27/2024 in #❓┊help
Set a cell type on exporter
No description
4 replies
FFilament
Created by Wannes on 4/17/2024 in #❓┊help
Infolist action on custom page
Hi there! I have a custom livewire page with a table. Now I want to have a view action which opens an infolist, but for some reason I don't get any popups. This is my table action:
->actions([
ViewAction::make('view')
->label('Bekijken')
->icon('heroicon-o-eye')
->infolist(function (Infolist $infolist) {
return $infolist
->schema([
TextEntry::make('lineItemable.name')->label('Naam'),
]);
}),
])
->actions([
ViewAction::make('view')
->label('Bekijken')
->icon('heroicon-o-eye')
->infolist(function (Infolist $infolist) {
return $infolist
->schema([
TextEntry::make('lineItemable.name')->label('Naam'),
]);
}),
])
I use the
InteractsWithInfolists
InteractsWithInfolists
trait and have the
HasInfolists
HasInfolists
interface. This is my view:
<div>
{{ $this->table }}

<x-filament-actions::modals />

</div>
<div>
{{ $this->table }}

<x-filament-actions::modals />

</div>
Is there something I am missing?
15 replies
FFilament
Created by Wannes on 4/17/2024 in #❓┊help
Group header columns in a table
No description
5 replies
FFilament
Created by Wannes on 2/26/2024 in #❓┊help
Translate Database Notifications?
Hi, is it possible to translate the database notifications? Especially if they are ran through a job. For example the new Export Action, which does this:
public static function getCompletedNotificationBody(Export $export): string
{
$body = 'Uw contacten export is voltooid en ' . number_format($export->successful_rows) . ' ' . trans_choice('general.row', $export->successful_rows) . ' werden geëxporteerd.';

if ($failedRowsCount = $export->getFailedRowsCount()) {
$body .= ' ' . number_format($failedRowsCount) . ' ' . trans_choice('general.row', $failedRowsCount) . ' werden niet geëxporteerd.';
}
}
public static function getCompletedNotificationBody(Export $export): string
{
$body = 'Uw contacten export is voltooid en ' . number_format($export->successful_rows) . ' ' . trans_choice('general.row', $export->successful_rows) . ' werden geëxporteerd.';

if ($failedRowsCount = $export->getFailedRowsCount()) {
$body .= ' ' . number_format($failedRowsCount) . ' ' . trans_choice('general.row', $failedRowsCount) . ' werden niet geëxporteerd.';
}
}
That text needs to be translated in Dutch, French and English. However in the database notifications table, I don't see a way how to make it translatable. Also in the redis itself I can't retrieve
app()->getLocale()
app()->getLocale()
because it always return the default locale. So I can't just handle it from there. Since notifications are user based, I'm fine to just push the translatable strings to the database, but I can't seem to figure out how to access the user his locale in a Redis Job.
2 replies
FFilament
Created by Wannes on 2/12/2024 in #❓┊help
Get all sortable columns of table
Hi, I'm trying to create some automated tests. So basically I want to execute all these tests (https://filamentphp.com/docs/3.x/tables/testing), but I'm trying to automate them. Now I'm wondering how I could get all the columns of my table which I specified with ->sortable() in my resource. Than I can just create a loop and execute my tests based on the fields.
9 replies
FFilament
Created by Wannes on 1/16/2024 in #❓┊help
Cache tables
Hi, is it possible to cache my tables in SPA, so they don't get to reloaded on every request? When they are loaded, they don't have to be reloaded. I'm using ->deferLoading(), on my table so it would be nice if a user shouldn't see the skeletton again if they have already loaded them 🙂
4 replies
FFilament
Created by Wannes on 1/15/2024 in #❓┊help
[3.2.0] Export to CSV relationships
Hi there! I'm trying out Filament 3.2, and it's amazing! However, when I try to use the dot notation to add a relationship in the export it just ignores it. Am I missing something?
public static function getColumns(): array
{
return [
ExportColumn::make('name')
->label('Naam'),
ExportColumn::make('type')
->label('Type'),
ExportColumn::make('email')
->label('E-mail'),
ExportColumn::make('phone')
->label('Telefoon'),
ExportColumn::make('vat_number')
->label('BTW nummer'),
ExportColumn::make('address.address')
->label('Adres'),
ExportColumn::make('address.zip_code')
->label('Postcode'),
ExportColumn::make('address.place')
->label('Woonplaats'),
ExportColumn::make('address.state_or_province')
->label('Provincie'),
ExportColumn::make('address.country.name')
->label('Land'),
ExportColumn::make('registration_number')
->label('Ondernemingsnummer'),
ExportColumn::make('notes')
->label('Notities'),
];
}
public static function getColumns(): array
{
return [
ExportColumn::make('name')
->label('Naam'),
ExportColumn::make('type')
->label('Type'),
ExportColumn::make('email')
->label('E-mail'),
ExportColumn::make('phone')
->label('Telefoon'),
ExportColumn::make('vat_number')
->label('BTW nummer'),
ExportColumn::make('address.address')
->label('Adres'),
ExportColumn::make('address.zip_code')
->label('Postcode'),
ExportColumn::make('address.place')
->label('Woonplaats'),
ExportColumn::make('address.state_or_province')
->label('Provincie'),
ExportColumn::make('address.country.name')
->label('Land'),
ExportColumn::make('registration_number')
->label('Ondernemingsnummer'),
ExportColumn::make('notes')
->label('Notities'),
];
}
30 replies
FFilament
Created by Wannes on 1/13/2024 in #❓┊help
Field is required CSV Importer
No description
34 replies
FFilament
Created by Wannes on 1/12/2024 in #❓┊help
SPA mode in Safari
No description
6 replies
FFilament
Created by Wannes on 1/5/2024 in #❓┊help
Change button label on create page
Hi, Is it possible to change the label of the button on the create page in the form? Without using Blade components. The "Create" and "Create & Add Another" labels. Thx in advance! 🙂
4 replies
FFilament
Created by Wannes on 12/29/2023 in #❓┊help
Tenancy + canAccessPanel
Hi! I'm using Filament v3 multi-tenancy and I have 2 panels. But only user A in tenant 1 should have access to the 2 panels. User A in tenant 2 should only have access to panel 1. I'm trying to accomplish this via the canAccessPanel() method in the User model, but I can't seem to access Filament::getTenant() in here.
public function canAccessPanel(Panel $panel): bool
{
// Need to access the team here?
}
public function canAccessPanel(Panel $panel): bool
{
// Need to access the team here?
}
` Is there any way to accomplish this? Kr, Wannes
3 replies
FFilament
Created by Wannes on 12/5/2023 in #❓┊help
Space between menu items
No description
3 replies
FFilament
Created by Wannes on 11/15/2023 in #❓┊help
File Upload
Hi, my file upload is not working as expected. It's always using the local disk, while I specifically tell it to use public. It always saves files under app/storage/livewire-tmp Also, in the database I just get this back: {"86debad5-ef3a-4570-99e7-8be320a4e9b4":{}} Which is not good enough to re-retrieve the file and display it on the view form... Is anyone familar with file upload and storing the path (or something else) to the database, and have it permanently? I've also done php artisan storage:link
FileUpload::make('logo')
->label('Logo')
->acceptedFileTypes(['image/png', 'image/jpg', 'image/jpeg'])
->downloadable()
->maxSize(32000)
->disk('public')
->maxFiles(1)
->preserveFilenames()
->image()
->imageEditor()
->imageEditorAspectRatios([
'16:9',
'4:3',
'1:1',
]),
FileUpload::make('logo')
->label('Logo')
->acceptedFileTypes(['image/png', 'image/jpg', 'image/jpeg'])
->downloadable()
->maxSize(32000)
->disk('public')
->maxFiles(1)
->preserveFilenames()
->image()
->imageEditor()
->imageEditorAspectRatios([
'16:9',
'4:3',
'1:1',
]),
`
2 replies
FFilament
Created by Wannes on 11/13/2023 in #❓┊help
Form with HasMany Relationship?
Hi, is it possible to create a form with a hasMany relationship? So I have an invoice with some default information (date, due date, customer....) but each invoice has to have LineItems. Is it possible for my form to create all the lineItems instead of adding it later via a relationshipmanager table? Kr, Wannes
4 replies
FFilament
Created by Wannes on 11/10/2023 in #❓┊help
Switching default locale
Hi, I need to make an admin panel for a client and I just started using filament for a smoother and faster development flow. I just can't seem to find where I set the default language to dutch. Is there an easy way to do this? All I find is how to create language switchers. I just need to set a different default locale. Thanks!
4 replies
FFilament
Created by Wannes on 11/8/2023 in #❓┊help
MultiTenancy EditProfile
Hi, I'm working on making my application multi-tenant, but I'm facing an issue when adding the EditTeamProfile page, I get the following error:

Route [filament.admin.tenant.profile] not defined.

Route [filament.admin.tenant.profile] not defined.
The registration page works just fine. Any one knows why? In my PanelProvider:
->tenant(model: Team::class, ownershipRelationship: 'team', slugAttribute: 'slug')
->tenantRegistration(RegisterTeam::class)
->tenantProfile(EditTeamProfile::class)
->tenant(model: Team::class, ownershipRelationship: 'team', slugAttribute: 'slug')
->tenantRegistration(RegisterTeam::class)
->tenantProfile(EditTeamProfile::class)
The EditTeamProfile class itself:
<?php

namespace App\Filament\Pages\Tenancy;

use Filament\Forms\Components\TextInput;
use Filament\Forms\Form;
use Filament\Pages\Tenancy\EditTenantProfile;
use Illuminate\Database\Eloquent\Model;

class EditTeamProfile extends EditTenantProfile
{
public static function getLabel(): string
{
return 'Team profile';
}

public function form(Form $form): Form
{
return $form
->schema([
TextInput::make('name'),
TextInput::make('slug')
]);
}
}
<?php

namespace App\Filament\Pages\Tenancy;

use Filament\Forms\Components\TextInput;
use Filament\Forms\Form;
use Filament\Pages\Tenancy\EditTenantProfile;
use Illuminate\Database\Eloquent\Model;

class EditTeamProfile extends EditTenantProfile
{
public static function getLabel(): string
{
return 'Team profile';
}

public function form(Form $form): Form
{
return $form
->schema([
TextInput::make('name'),
TextInput::make('slug')
]);
}
}
2 replies
FFilament
Created by Wannes on 11/3/2023 in #❓┊help
Toggle as Action
Hi, is it possible to have an action that is basically a toggle? So this: https://filamentphp.com/docs/3.x/forms/fields/toggle but than as an Action Kr, Wannes
12 replies