kirschbaum-development / nova-inline-relationship

A package to present relationships as inline properties in Nova.
MIT License
198 stars 83 forks source link

Does not work with Translatable #9

Open nemrutco opened 5 years ago

nemrutco commented 5 years ago

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'),
        ];
    }
kamilkozak commented 5 years ago

same issue here

nemrutco commented 5 years ago

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.

khalil-htme commented 5 years ago

issue still happening

michaelfox commented 4 years ago

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!

109digital commented 4 years ago

Same issue here.

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

abdulwahid commented 4 years ago

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

adrienne commented 4 years ago

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

Reached commented 3 years ago

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

Adizbek commented 2 years ago

Same issue here.