Php 我的翻译正在覆盖所有值-旅行者1.4.0
我使用的是Laravel7和旅行者1.4.0Php 我的翻译正在覆盖所有值-旅行者1.4.0,php,laravel,voyager,Php,Laravel,Voyager,我使用的是Laravel7和旅行者1.4.0 'multilingual' => [ /* * Set whether or not the multilingual is supported by the BREAD input. */ 'enabled' => true, /* * Select default language */ 'default' => 'pl', /*
'multilingual' => [
/*
* Set whether or not the multilingual is supported by the BREAD input.
*/
'enabled' => true,
/*
* Select default language
*/
'default' => 'pl',
/*
* Select languages that are supported.
*/
'locales' => [
'pl',
'en'
],
],
页面模型
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Page extends Model
{
public static function findBySlug($slug){
return static::where('status', 'ACTIVE')->where('slug', $slug)->firstOrFail();
}
}
我进行编写器更新,清除引导/缓存,但没有任何帮助。。当我修改post id 1中的值并保存它时。它将覆盖所有表中的所有值。。在英语中
<?php
namespace App;
use App\Category;
use Illuminate\Database\Eloquent\Model;
use TCG\Voyager\Traits\Translatable;
class Post extends Model
{
use Translatable;
protected $translatable = ['title', 'body', 'excerpt', 'meta_description', 'meta_keywords', 'seo_title', 'slug'];
protected $fillable = [
'category_id',
'user_id',
"title",
'content',
'slug',
'featured_image',
'is_featured',
'is_published'
];
public function tags(){
return $this->belongsToMany('App\Tag', 'tag_post');
}
public function category(){
return $this->belongsTo('App\Category');
}
public function user(){
return $this->belongsTo('App\User');
}
public function getRouteKeyName(){
return 'slug';
}
}