jamesro
jamesro
FFilament
Created by jamesro on 2/14/2025 in #❓┊help
Wizard step afterValidation get only form fields of that step only
I was thinking of setting ->statePath('step-name') for each step, is that the correct aproach ?
3 replies
FFilament
Created by jamesro on 2/12/2025 in #❓┊help
Wizzard multiple entities per each wizzard step
i don't see any option in wizzard step to set a relation unfortunately
7 replies
FFilament
Created by jamesro on 2/12/2025 in #❓┊help
Wizzard multiple entities per each wizzard step
@Dan Harrin any idea if this is doable ?
7 replies
FFilament
Created by jamesro on 2/10/2025 in #❓┊help
Custom table query, lost when i'm using custom filters,
this is my filters code
protected function getTableFilters(): array
{
return [
SelectFilter::make('disabled')
->indicateUsing(function (array $data) {
$indicators = [];

if($data['an'] !== null) {
$indicators['an'] = Indicator::make('Anul: '.$data['an']) ;
}

return $indicators;
})
->label('Status')
->form([
Select::make('an')
->searchable()
->afterStateUpdated(function ($state) {
$this->an = $state;
})
->options(function () {
$currentYear = date('Y');
$options = [];
for ($i = $currentYear; $i >= 2021; $i--) {
$options[$i] = $i;
}
return $options;
}),
])
->query(function (Builder $query, array $data): Builder {
return $query->when(
$data['an'],
fn (Builder $query, $an): Builder => $query->leftJoin('plan_concediu as pc', function ($join) use ($data) {
$join->on('users.id', '=', 'pc.id_user')
->where('pc.team_id', $this->teamId)
->where('pc.anul', '=', data['an']);
}),
);
})
];
}
protected function getTableFilters(): array
{
return [
SelectFilter::make('disabled')
->indicateUsing(function (array $data) {
$indicators = [];

if($data['an'] !== null) {
$indicators['an'] = Indicator::make('Anul: '.$data['an']) ;
}

return $indicators;
})
->label('Status')
->form([
Select::make('an')
->searchable()
->afterStateUpdated(function ($state) {
$this->an = $state;
})
->options(function () {
$currentYear = date('Y');
$options = [];
for ($i = $currentYear; $i >= 2021; $i--) {
$options[$i] = $i;
}
return $options;
}),
])
->query(function (Builder $query, array $data): Builder {
return $query->when(
$data['an'],
fn (Builder $query, $an): Builder => $query->leftJoin('plan_concediu as pc', function ($join) use ($data) {
$join->on('users.id', '=', 'pc.id_user')
->where('pc.team_id', $this->teamId)
->where('pc.anul', '=', data['an']);
}),
);
})
];
}
5 replies
FFilament
Created by jamesro on 2/10/2025 in #❓┊help
Custom table query, lost when i'm using custom filters,
this is my table query method
return User::query()
->select('departament.id as id_departament', 'users.id as id', 'users.nume as nume', 'users.email as email',
'departament.nume as nume_departament', 'tu.locatie as locatie', 'pc.trimis as planificare_trimis_status')
->leftJoin('team_user as tu', 'users.id', '=', 'tu.user_id') // Join team_user table
->leftJoin('plan_concediu as pc', function ($join) {
$join->on('users.id', '=', 'pc.id_user')
->where('pc.team_id', Filament::getTenant()->id)
->where('pc.anul', '=', $this->anu);
})
return User::query()
->select('departament.id as id_departament', 'users.id as id', 'users.nume as nume', 'users.email as email',
'departament.nume as nume_departament', 'tu.locatie as locatie', 'pc.trimis as planificare_trimis_status')
->leftJoin('team_user as tu', 'users.id', '=', 'tu.user_id') // Join team_user table
->leftJoin('plan_concediu as pc', function ($join) {
$join->on('users.id', '=', 'pc.id_user')
->where('pc.team_id', Filament::getTenant()->id)
->where('pc.anul', '=', $this->anu);
})
5 replies
FFilament
Created by jamesro on 2/6/2025 in #❓┊help
How to change the order of navigation group sub-items
my bad seems it works, was just because some of my other resources didnt had all $navigationSort set
15 replies
FFilament
Created by jamesro on 2/6/2025 in #❓┊help
How to change the order of navigation group sub-items
TeamUserResource itself is a sub-item of the group
protected static ?string $navigationGroup = 'Admin';

protected static ?string $navigationLabel = 'Team Users';

protected static ?string $label = 'Team User';

protected static ?string $pluralLabel = 'Team Users';

protected static ?string $slug = 'teamusers';

protected static ?int $navigationSort = 1;
protected static ?string $navigationGroup = 'Admin';

protected static ?string $navigationLabel = 'Team Users';

protected static ?string $label = 'Team User';

protected static ?string $pluralLabel = 'Team Users';

protected static ?string $slug = 'teamusers';

protected static ?int $navigationSort = 1;
15 replies
FFilament
Created by jamesro on 2/6/2025 in #❓┊help
How to change the order of navigation group sub-items
i've just added protected static ?int $navigationSort = 1; in my TeamUserResource, which is assigned to Admin group with protected static ?string $navigationGroup = 'Admin'; but the position of TeamUsers still shows last in the group sub-items
15 replies
FFilament
Created by jamesro on 2/6/2025 in #❓┊help
How to change the order of navigation group sub-items
@Bruno Pereira doesn't seems to be working, the ->navigationGroups([ 'Shop', change to correct order 'Blog', 'Settings', ]) works, changes the order, but when i try to change a sub-item order in a group it still seems to be using alphabetic ordering
15 replies
FFilament
Created by jamesro on 2/6/2025 in #❓┊help
How to change the order of navigation group sub-items
oky will try
15 replies
FFilament
Created by jamesro on 2/6/2025 in #❓┊help
How to change the order of navigation group sub-items
@Bruno Pereira i tried that, but its changing the group order not the order of that group sub-item linked to a resource/page
15 replies
FFilament
Created by jamesro on 1/29/2025 in #❓┊help
Set css class per repeater item
understand, would be nice if filament could do this
11 replies
FFilament
Created by jamesro on 1/29/2025 in #❓┊help
Set css class per repeater item
I’m using repeater to manage entity relationship where the entity can have multiple such items Example and order with multiple products …
11 replies
FFilament
Created by jamesro on 1/29/2025 in #❓┊help
Set css class per repeater item
I want to be able to set it for each item individually
11 replies
FFilament
Created by code eater on 1/19/2024 in #❓┊help
Call to a member function isRelation() on null
this is how I solved on such error
->createOptionForm(function (Form $form) {
return DepartamentResource::form($form);
})
->createOptionForm(function (Form $form) {
return DepartamentResource::form($form);
})
14 replies
FFilament
Created by Mark Chaney on 3/13/2024 in #❓┊help
Call to a member function isRelation() on null
this is how I solved on such error
->createOptionForm(function (Form $form) {
return DepartamentResource::form($form);
})
->createOptionForm(function (Form $form) {
return DepartamentResource::form($form);
})
3 replies
FFilament
Created by jamesro on 11/5/2024 in #❓┊help
Custom page with table and filters
seems in order to work so that the filters appear on my url when filters are applied, you need to add this on the page:
protected $queryString = [
'tableSortColumn',
'tableSortDirection',
'tableSearchQuery' => ['except' => ''],
'tableFilters',
];
protected $queryString = [
'tableSortColumn',
'tableSortDirection',
'tableSearchQuery' => ['except' => ''],
'tableFilters',
];
5 replies
FFilament
Created by jamesro on 11/5/2024 in #❓┊help
Custom page with table and filters
@arnaudsf i do use the filters values in my query, but still, i don't see those filters applied in my browser url as they are normally showing for a resource page
5 replies
FFilament
Created by lzx1996 on 6/20/2023 in #❓┊help
table builder unable to filter/paginate if using composite primary key
@Dennis Koch is this still not supported?
4 replies