main

filamentphp/demo

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

ListBrands.php

TLDR

This file defines the ListBrands class which extends the ListRecords class. It provides a static property $resource and a method getActions().

Classes

ListBrands

The ListBrands class extends the ListRecords class and is located in the App\Filament\Resources\Shop\BrandResource\Pages namespace. It provides a static property $resource which is set to BrandResource::class. This class also includes a method getActions() that returns an array of actions. In this case, it returns an array that contains a CreateAction.

<?php

namespace App\Filament\Resources\Shop\BrandResource\Pages;

use App\Filament\Resources\Shop\BrandResource;
use Filament\Actions;
use Filament\Resources\Pages\ListRecords;

class ListBrands extends ListRecords
{
    protected static string $resource = BrandResource::class;

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