main

filamentphp/demo

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

CreateLink.php

TLDR

This file contains the CreateLink class, which extends the CreateRecord class. It is used as a page resource in the LinkResource of the Blog module in the Filament project. The class includes a method called getHeaderActions() that returns an array of header actions.

Classes

CreateLink

This class extends the CreateRecord class and is used as a page resource in the LinkResource of the Blog module in the Filament project. It includes the Translatable trait and defines a static property $resource which is set to LinkResource::class. The class also includes a method called getHeaderActions() that returns an array of header actions.

<?php

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

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

class CreateLink extends CreateRecord
{
    use CreateRecord\Concerns\Translatable;

    protected static string $resource = LinkResource::class;

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