Ateus
Ateus
FFilament
Created by Ateus on 2/5/2024 in #❓┊help
Group Action for Table
Is it possible to execute a action on items that are grouped? https://filamentphp.com/docs/3.x/tables/grouping
1 replies
FFilament
Created by Ateus on 1/18/2024 in #❓┊help
One column per relationship model in table
Got products with options, would like to display the options in columns like "option name1" "value 1", "option name2" "value" would it be possible to have filament make a new column for each relationship?
2 replies
FFilament
Created by Ateus on 1/4/2024 in #❓┊help
Add Table to BulkAction
Hey. Can i add a table to this bulk action? I've tried using $this->table but i'm not sure how it works, could someone nudge me in the right direction?
<?php

namespace App\Filament\Tables\Actions;

class JoinProductsBulkAction extends BulkAction
{
use CanCustomizeProcess;

public static function getDefaultName(): ?string
{
return 'delete';
}

protected function setUp(): void
{
parent::setUp();

$this->label(__('Join multiple'));

$this->modalHeading(fn (): string => __('filament-actions::delete.multiple.modal.heading', ['label' => $this->getPluralModelLabel()]));

$this->modalSubmitActionLabel(__('filament-actions::delete.multiple.modal.actions.delete.label'));

$this->successNotificationTitle(__('filament-actions::delete.multiple.notifications.deleted.title'));

$this->color('danger');

$this->icon(FilamentIcon::resolve('actions::delete-action') ?? 'heroicon-m-trash');

// $this->requiresConfirmation();

$this->modalIcon(FilamentIcon::resolve('actions::delete-action.modal') ?? 'heroicon-o-trash');

$this->form([

TextInput::make('New name')
->required(),
]);

$this->action(function (): void {
$this->process(static fn (Collection $records) => $records->each(fn (Model $record) => $record->delete()));

$this->success();
});

$this->slideOver();

$this->closeModalByClickingAway(false);

$this->deselectRecordsAfterCompletion();
}
}
<?php

namespace App\Filament\Tables\Actions;

class JoinProductsBulkAction extends BulkAction
{
use CanCustomizeProcess;

public static function getDefaultName(): ?string
{
return 'delete';
}

protected function setUp(): void
{
parent::setUp();

$this->label(__('Join multiple'));

$this->modalHeading(fn (): string => __('filament-actions::delete.multiple.modal.heading', ['label' => $this->getPluralModelLabel()]));

$this->modalSubmitActionLabel(__('filament-actions::delete.multiple.modal.actions.delete.label'));

$this->successNotificationTitle(__('filament-actions::delete.multiple.notifications.deleted.title'));

$this->color('danger');

$this->icon(FilamentIcon::resolve('actions::delete-action') ?? 'heroicon-m-trash');

// $this->requiresConfirmation();

$this->modalIcon(FilamentIcon::resolve('actions::delete-action.modal') ?? 'heroicon-o-trash');

$this->form([

TextInput::make('New name')
->required(),
]);

$this->action(function (): void {
$this->process(static fn (Collection $records) => $records->each(fn (Model $record) => $record->delete()));

$this->success();
});

$this->slideOver();

$this->closeModalByClickingAway(false);

$this->deselectRecordsAfterCompletion();
}
}
2 replies