Fix: admin/manager land on edit page, viewer on view page
Deploy / deploy (push) Successful in 16s

Filament checks view before edit for row URL. Added a shared
ViewRecord base that redirects to edit if canEdit() is true,
so admins and managers get the editable form directly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Malek TellissiandClaude Sonnet 4.6 committed 2026-09-13 03:05:05 +02:00
1 parent 9f42f730b8
commit 0500cab160
8 files changed
+26 -7

No files matched your search

+19
View File
@@ -0,0 +1,19 @@
<?php
namespace App\Filament\Pages;
use Filament\Resources\Pages\ViewRecord as BaseViewRecord;
class ViewRecord extends BaseViewRecord
{
public function mount(int|string $record): void
{
parent::mount($record);
$resource = static::getResource();
if ($resource::canEdit($this->record)) {
$this->redirect($resource::getUrl('edit', ['record' => $this->record]));
}
}
}