Skip to content

05. TiMEX filament resource

Michael edited this page Dec 19, 2022 · 1 revision

TiMEX filament resource, laravel models & DB tables

#resources

event (resource)
  • Filament resource class (default: \Buildix\EventResource::class)
    'resources' => [
        'event' => \Buildix\Timex\Resources\EventResource::class,
    ],
    You may create your own filament resource class & pages in order to list / manage your events. After creating your filament resource, make sure to register it in timex.php config
sort
  • Integer (default: 1)
    'resources' => [
        'sort' => 1,
    ],
    Filament navigation item sorting
icon
  • String (default: heroicon-o-calendar)
    'resources' => [
        'icon' => 'heroicon-o-calendar',
    ],
    Filament navigation icon
slug
  • String (default: timex-events)
    'resources' => [
        'slug' => 'timex-events',
    ],
    Slug is used to define the url of your resource page
shouldRegisterNavigation
  • Boolean (default: true)

    'resources' => [
        'shouldRegisterNavigation' => true,
    ],

    If it's true, TiMEX filament resource will be registered on your navigation panel

    If enablePolicy is te to true option shouldRegisterNavigation will be ignored and access to TiMEX filament resource will be configured in accordance with your laravel policies made for TiMEX event model

#models

event (model)
  • Laravel model (default: \Buildix\Event::class)
    'models' => [
        'event' => \Buildix\Timex\Models\Event::class,
    ],
    You may create your own laravel model to store your events. After creating your laravel model, make sure to register it in timex.php config
users
  • Laravel model (default: \App\Models\User::class)
    'models' => [
        'users' => [
            'model' => \App\Models\User::class,
            'name' => 'name',
            'id' => 'id',
        ],
    ],

#tables

event (#name)
  • String (default: timex_events)
    'tables' => [
        'event' => [
            'name' => 'timex_events',
        ],
    ],
    Name of your DB table to store TiMEX events. You may change to any other name that fits your application.
category (#name)
  • String (default: timex_categories)
    'tables' => [
        'category' => [
            'name' => 'timex_categories',
        ],
    ],
    Name of your DB table to store TiMEX categories. You may change to any other name that fits your application.