thedevdojo / voyager

Voyager - The Missing Laravel Admin
https://voyager.devdojo.com
MIT License
11.77k stars 2.67k forks source link

Undefined index:fr when updating or creating a referential (Already saw #3115 and the others) #5550

Open JonDelWeb opened 2 years ago

JonDelWeb commented 2 years ago

Laravel version

6.2

PHP version

7.2

Voyager version

1.5

Database

10.6.5

Description

Error occurs when I create and update a referential. only this has problem.

Steps to reproduce

I create a model :

`<?php namespace App; use TCG\Voyager\Traits\Translatable; use Illuminate\Database\Eloquent\Model; class Referential extends Model { use Translatable;

protected $translatable = ['logo', 'title', 'content', 'category', 'language'];

}`

A table :

public function up() { Schema::create('referentials', function (Blueprint $table) { $table->bigIncrements('id'); $table->string('logo'); $table->string('title'); $table->text('content'); $table->string('category'); $table->string('language'); $table->boolean('active'); $table->timestamps(); }); }

I also create the BREAD manually in voyager admin.

But I have this issue when I try to add or update a referential :

Undefined index: fr

$request->merge([$field => $trans[config('voyager.multilingual.default', 'en')]]);

My Voyager config :

`'multilingual' => [ /*

Expected behavior

I would like create or update a referential

Screenshots

No response

Additional context

Please, don't tell me to search other issues for that... ;) (Sorry for the display, there seems to be a problem with the code display...)

JonDelWeb commented 2 years ago

Any idea ?