Fossil
Fossil
FFilament
Created by Fossil on 1/5/2025 in #❓┊help
searchable method makes columns all same width
->searchable(isIndividual: true, isGlobal: false) ->searchable(isIndividual: true, isGlobal: false) Yeah, removing this from columns makes the table super condensed. And each column is a different size now.
17 replies
FFilament
Created by Fossil on 1/5/2025 in #❓┊help
searchable method makes columns all same width
Looks like when I remove the search box row from the HTML the columns actually srhinks down a lot
17 replies
FFilament
Created by Fossil on 1/5/2025 in #❓┊help
searchable method makes columns all same width
->compact() would be nice to have on a table
17 replies
FFilament
Created by Fossil on 1/5/2025 in #❓┊help
searchable method makes columns all same width
Width does add the style to the <th> but it stays at 192px for some reason
17 replies
FFilament
Created by Fossil on 1/5/2025 in #❓┊help
searchable method makes columns all same width
Cheers
17 replies
FFilament
Created by Fossil on 1/5/2025 in #❓┊help
searchable method makes columns all same width
No changes
17 replies
FFilament
Created by Fossil on 1/5/2025 in #❓┊help
searchable method makes columns all same width
Tried both yeah
17 replies
FFilament
Created by Fossil on 1/5/2025 in #❓┊help
searchable method makes columns all same width
They are all 192px
17 replies
FFilament
Created by Fossil on 1/5/2025 in #❓┊help
searchable method makes columns all same width
public static function table(Table $table): Table
{
return $table
->columns([
TextColumn::make('username')->searchable(isIndividual: true, isGlobal: false),
TextColumn::make('email')->searchable(isIndividual: true, isGlobal: false),
TextColumn::make('roles.name')->label('Role'),
TextColumn::make('lastlogin')->dateTime('d-m-Y H:i:s')->label('Last Login'),
TextColumn::make('apiaccess')->dateTime('d-m-Y H:i:s')->label('Last API'),
IconColumn::make('verified')->boolean(),
IconColumn::make('bad_user')->boolean()->label('Bad User'),
IconColumn::make('passwordsecurity.google2fa_enable')->boolean()->label('2FA')->default(0),
])
->filters(
[

],
layout: \Filament\Tables\Enums\FiltersLayout::AboveContent,
)
->actions([
Tables\Actions\ViewAction::make()->slideOver(),
Tables\Actions\EditAction::make()->slideOver()->after(function (User $record, Role $role) {
$record->syncRoles($record->role->name);
$role = $role->findByName($record->role->name);
$record->givePermissionTo($role->findByName($record->role->name, null)->permissions->pluck('name'));
}),
Tables\Actions\Action::make('disable')
->label('2FA')
->action(fn (User $record) => $record->disable2FA())
->requiresConfirmation()
->icon('heroicon-o-lock-closed')
->color('danger'),
Tables\Actions\DeleteAction::make(),
])
->bulkActions([
Tables\Actions\DeleteBulkAction::make()
->requiresConfirmation(),
]);

}
public static function table(Table $table): Table
{
return $table
->columns([
TextColumn::make('username')->searchable(isIndividual: true, isGlobal: false),
TextColumn::make('email')->searchable(isIndividual: true, isGlobal: false),
TextColumn::make('roles.name')->label('Role'),
TextColumn::make('lastlogin')->dateTime('d-m-Y H:i:s')->label('Last Login'),
TextColumn::make('apiaccess')->dateTime('d-m-Y H:i:s')->label('Last API'),
IconColumn::make('verified')->boolean(),
IconColumn::make('bad_user')->boolean()->label('Bad User'),
IconColumn::make('passwordsecurity.google2fa_enable')->boolean()->label('2FA')->default(0),
])
->filters(
[

],
layout: \Filament\Tables\Enums\FiltersLayout::AboveContent,
)
->actions([
Tables\Actions\ViewAction::make()->slideOver(),
Tables\Actions\EditAction::make()->slideOver()->after(function (User $record, Role $role) {
$record->syncRoles($record->role->name);
$role = $role->findByName($record->role->name);
$record->givePermissionTo($role->findByName($record->role->name, null)->permissions->pluck('name'));
}),
Tables\Actions\Action::make('disable')
->label('2FA')
->action(fn (User $record) => $record->disable2FA())
->requiresConfirmation()
->icon('heroicon-o-lock-closed')
->color('danger'),
Tables\Actions\DeleteAction::make(),
])
->bulkActions([
Tables\Actions\DeleteBulkAction::make()
->requiresConfirmation(),
]);

}
17 replies
FFilament
Created by Fossil on 1/5/2025 in #❓┊help
searchable method makes columns all same width
No description
17 replies
FFilament
Created by Fossil on 1/5/2025 in #❓┊help
searchable method makes columns all same width
Tried that. No go. Seems like the width is decided higher up in the HTML 😦
17 replies
FFilament
Created by Fossil on 5/18/2024 in #❓┊help
2FA Middleware
I added it to both middleware and authmiddleware now and it seems to finally work in prod now too. Cheers!
22 replies
FFilament
Created by Fossil on 5/18/2024 in #❓┊help
2FA Middleware
Ah damn. Whenever I login with user/pass, I get shown the 2FA screen (diff URL). If I dont enter 2FA and instead open the dashboard (Filament) URL I am logged into Filament and can do anything. So need to make Filament aware of 2FA being logged in or not somehow
22 replies