I'm make a trait to get simple set $view file of page view to my custom view file.
namespace App\Filament\Concerns;
use Filament\Resources\Pages\EditRecord;
use Filament\Resources\Pages\ViewRecord;
trait FastRelationManagerTab
{
public function getView(): string
{
if ($this instanceof EditRecord) {
return 'filament.resources.edit-record';
} elseif ($this instanceof ViewRecord) {
return 'filament.resources.view-record';
} else {
return parent::$view;
}
}
}
I wonder that If I want to set to all ViewRecord pages, how I can do so.
I wish I can do on ServiceProvider, Please advise, I want to set view file something like 'filament.resources.view-record'