EditLink.php
TLDR
This file defines the EditLink
class, which extends the EditRecord
class. It provides the getHeaderActions
method to return an array of header actions for the EditLink page.
Classes
EditLink
The EditLink
class extends the EditRecord
class. It includes the Translatable
concern and sets the $resource
property to the LinkResource
class. The class provides the getHeaderActions
method, which returns an array of header actions for the EditLink page.
<?php
namespace App\Filament\Resources\Blog\LinkResource\Pages;
use App\Filament\Resources\Blog\LinkResource;
use Filament\Actions;
use Filament\Resources\Pages\EditRecord;
class EditLink extends EditRecord
{
use EditRecord\Concerns\Translatable;
protected static string $resource = LinkResource::class;
protected function getHeaderActions(): array
{
return [
Actions\ViewAction::make(),
Actions\DeleteAction::make(),
Actions\LocaleSwitcher::make(),
];
}
}