Skip to content

Commit 6633b7f

Browse files
authored
Merge pull request #62 from lara-zeus/open-dept-in-edit
add action to open department when editing
2 parents 5876d59 + 48cf3ee commit 6633b7f

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/Filament/Resources/DepartmentResource/Pages/EditDepartment.php

+16
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace LaraZeus\Wind\Filament\Resources\DepartmentResource\Pages;
44

5+
use Filament\Pages\Actions\Action;
56
use Filament\Resources\Pages\EditRecord;
67
use LaraZeus\Wind\Filament\Resources\DepartmentResource;
78

@@ -15,4 +16,19 @@ public function mount($record): void /* @phpstan-ignore-line */
1516

1617
parent::mount($record);
1718
}
19+
20+
protected function getActions(): array
21+
{
22+
return array_merge(
23+
parent::getActions(),
24+
[
25+
Action::make('Open')
26+
->color('warning')
27+
->icon('heroicon-o-external-link')
28+
->label(__('Open'))
29+
->url(fn (): string => route('contact', ['departmentSlug' => $this->record]))
30+
->openUrlInNewTab(),
31+
],
32+
);
33+
}
1834
}

0 commit comments

Comments
 (0)