lara-zeus / sky

CMS for your website. it include posts, pages, tags, and categories. with a frontend scaffolding ready to use
https://larazeus.com/sky
MIT License
142 stars 27 forks source link

Issue when using spatie translatable #203

Closed jimiero closed 1 week ago

jimiero commented 5 months ago

Hello @atmonshi

I'm trying to use the navigation builder on a custom resource, but I'm having an issue

I want my resource to be translatable with spatie translatable package,

now when I use:

ViewField::make('items') ->label(__('zeus-sky::filament-navigation.attributes.items')) ->default([]) ->view('zeus::filament.navigation-builder'),

clicking on "Add item" doesn't open the modal window so I can create item

It works only if I go to my CreateResource and remove:

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

but I need that so i can switch language to translate the resource, any idea?

jimiero commented 5 months ago

Oky I've found a way seems..

I created my custom NavigationBuilder trait and inside

protected function getActions(): array

i've added:

Actions\LocaleSwitcher::make(),

and now I get the language switcer present in my form page