Skip to content

Commit 9617cb4

Browse files
committed
add action to open department when editing
1 parent 5876d59 commit 9617cb4

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
@@ -3,6 +3,7 @@
33
namespace LaraZeus\Wind\Filament\Resources\DepartmentResource\Pages;
44

55
use Filament\Resources\Pages\EditRecord;
6+
use Filament\Pages\Actions\Action;
67
use LaraZeus\Wind\Filament\Resources\DepartmentResource;
78

89
class EditDepartment extends EditRecord
@@ -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)