main

filamentphp/demo

Last updated at: 29/12/2023 09:42

ViewLink.php

TLDR

This file is a part of the Demo Projects project and it is located at app/Filament/Resources/Blog/LinkResource/Pages/ViewLink.php. It defines a class ViewLink which extends the ViewRecord class and is used for viewing a record. It uses the LinkResource class as the resource and provides some header actions.

Classes

ViewLink

The ViewLink class extends the ViewRecord class and is used for viewing a record. It is a part of the Demo Projects project and is located at app/Filament/Resources/Blog/LinkResource/Pages/ViewLink.php. It uses the LinkResource class as the resource. The class also includes the Translatable concern. The class provides the getHeaderActions method which returns an array of header actions including the 'EditAction' and 'LocaleSwitcher' actions.

<?php

namespace App\Filament\Resources\Blog\LinkResource\Pages;

use App\Filament\Resources\Blog\LinkResource;
use Filament\Actions;
use Filament\Resources\Pages\ViewRecord;

class ViewLink extends ViewRecord
{
    use ViewRecord\Concerns\Translatable;

    protected static string $resource = LinkResource::class;

    protected function getHeaderActions(): array
    {
        return [
            Actions\EditAction::make(),
            Actions\LocaleSwitcher::make(),
        ];
    }
}