Skip to content

Commit

Permalink
Merge pull request #11955 from filamentphp/fix/table-action-group-wit…
Browse files Browse the repository at this point in the history
…h-record-hidden-closure
  • Loading branch information
danharrin committed Mar 20, 2024
1 parent 728c31d commit ea6d13f
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/03-resources/03-creating-records.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ use Filament\Notifications\Notification;

protected function beforeCreate(): void
{
if (! $this->getRecord()->team->subscribed()) {
if (! auth()->user()->team->subscribed()) {
Notification::make()
->warning()
->title('You don\'t have an active subscription!')
Expand Down
22 changes: 22 additions & 0 deletions docs/03-resources/07-relation-managers.md
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,17 @@ AttachAction::make()
->recordSelectSearchColumns(['title', 'description'])
```

### Attaching multiple records

The `multiple()` method on the `AttachAction` component allows you to select multiple values:

```php
use Filament\Tables\Actions\AttachAction;

AttachAction::make()
->multiple()
```

### Customizing the select field in the attached modal

You may customize the select field object that is used during attachment by passing a function to the `recordSelect()` method:
Expand Down Expand Up @@ -440,6 +451,17 @@ AssociateAction::make()
->recordSelectSearchColumns(['title', 'description'])
```

### Associating multiple records

The `multiple()` method on the `AssociateAction` component allows you to select multiple values:

```php
use Filament\Tables\Actions\AssociateAction;

AssociateAction::make()
->multiple()
```

### Customizing the select field in the associate modal

You may customize the select field object that is used during association by passing a function to the `recordSelect()` method:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
wire:ignore
:attributes="
\Filament\Support\prepare_inherited_attributes($attributes)
->class(['md:hidden'])
->class(['fi-page-sub-navigation-select md:hidden'])
"
>
<x-filament::input.select
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<ul
wire:ignore
{{ $attributes->class(['hidden w-72 flex-col gap-y-7 md:flex']) }}
{{ $attributes->class(['fi-page-sub-navigation-sidebar hidden w-72 flex-col gap-y-7 md:flex']) }}
>
@foreach ($navigation as $navigationGroup)
<x-filament-panels::sidebar.group
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
wire:ignore
:attributes="
\Filament\Support\prepare_inherited_attributes($attributes)
->class(['hidden md:flex'])
->class(['fi-page-sub-navigation-tabs hidden md:flex'])
"
>
@foreach ($navigation as $navigationGroup)
Expand Down
9 changes: 9 additions & 0 deletions src/Resources/Pages/ListRecords.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Filament\Resources\Pages;

use Filament\Actions\Action;
use Filament\Actions\Contracts\HasRecord;
use Filament\Actions\CreateAction;
use Filament\Facades\Filament;
use Filament\Forms\Form;
Expand Down Expand Up @@ -255,6 +256,10 @@ protected function makeTable(): Table

$action->record($record);

if (($actionGroup = $action->getGroup()) instanceof HasRecord) {
$actionGroup->record($record);
}

if ($action->isHidden()) {
continue;
}
Expand All @@ -279,6 +284,10 @@ protected function makeTable(): Table

$action->record($record);

if (($actionGroup = $action->getGroup()) instanceof HasRecord) {
$actionGroup->record($record);
}

if ($action->isHidden()) {
continue;
}
Expand Down

0 comments on commit ea6d13f

Please sign in to comment.