voyager icon indicating copy to clipboard operation
voyager copied to clipboard

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

Open JonDelWeb opened this issue 3 years ago • 1 comments

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' => [ /* * Set whether or not the multilingual is supported by the BREAD input. */ 'enabled' => true,

    /*
     * Select default language
     */
    'default' => 'fr',

    /*
     * Select languages that are supported.
     */
    'locales' => [
        'fr',
        'es',
        'en'
    ],`

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 avatar Mar 08 '22 09:03 JonDelWeb

Any idea ?

JonDelWeb avatar Mar 14 '22 13:03 JonDelWeb