nova-inline-relationship icon indicating copy to clipboard operation
nova-inline-relationship copied to clipboard

Does not work with Translatable

Open nemrutco opened this issue 5 years ago • 9 comments

I try to use it with Spatie's Translatable package but it ignores the text fields within Translatable. But somehow Repeater field still shows and i can add without issue. And also another thing is when i put them out of the Translatable, title fields shows but placeholder of title field becomes [object,object].

// MapInfo Resource 
public function fields(Request $request)
    {
        return [
            ID::make()->sortable(),
            Translatable::make([
                Text::make(__('Title'), 'title')
                    ->rules('required'),
                Repeater::make(__('Infos'), 'infos')
                    ->addField([
                        'label' => 'Item',
                    ])->rules('required'),
            ]),
            BelongsTo::make('Floor'),
        ];
    }
// Floor Resource 
    public function fields(Request $request)
    {
        return [
            ID::make()->sortable(),
            Translatable::make([
                Text::make(__('Title'), 'title')
                    ->rules('required'),
            ]),
            HasMany::make(__('Map Info'), 'map_info', MapInfo::class)->inline(), //tried w/o "MapInfo::class"
            BelongsTo::make(__('Map'), 'map'),
        ];
    }

nemrutco avatar Sep 09 '19 13:09 nemrutco

same issue here

kamilkozak avatar Sep 17 '19 15:09 kamilkozak

same issue here

I fixed it but i changed a lot since then. Maybe i can help you if you show me your models and how you setup your relations. So far what i can tell you is try MorphToMany instead of HasMany as based on my example Floor Resource.

nemrutco avatar Sep 17 '19 16:09 nemrutco

issue still happening

khalil-htme avatar Oct 04 '19 05:10 khalil-htme

Hi @nemrutco! Thanks for the feedback on this issue. We've been busy but are hoping to carve some time out soon.

If you've already put in the work we would appreciate your contribution–via pull request or even just a description of your solution.

Thanks again!

michaelfox avatar Nov 26 '19 20:11 michaelfox

Same issue here.

@nemrutco can you advise how you were able to work around it?

109digital avatar Jan 11 '20 18:01 109digital

Same issue here. Also it shows fields labels like resource_name[0][column_name].

abdulwahid avatar Jan 11 '20 18:01 abdulwahid

Yes. I would also like if it worked with the similar https://framagit.org/yeswedev/ywd_nova-translatable (which uses astrotomic/translatable)

adrienne avatar Feb 11 '20 13:02 adrienne

I have the same issue, anyone who succeeded here? :)

Reached avatar Dec 02 '20 16:12 Reached

Same issue here.

Adizbek avatar Apr 21 '22 01:04 Adizbek