edit multi-language models
This commit is contained in:
parent
0e88d76bdc
commit
ad42e73126
10 changed files with 351 additions and 119 deletions
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace App\Models;
|
||||
|
||||
// 1. To specify package’s class you are using
|
||||
use App\Models\ModelTrait;
|
||||
use App\Models\User;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
@ -10,16 +11,18 @@ use Dimsav\Translatable\Translatable;
|
|||
class Page extends Model
|
||||
{
|
||||
use ModelTrait;
|
||||
use Translatable;
|
||||
/**
|
||||
use Translatable; // 2. To add translation methods
|
||||
|
||||
// 3. To define which attributes needs to be translated
|
||||
public $translatedAttributes = ['title', 'description'];
|
||||
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table;
|
||||
|
||||
public $translatedAttributes = ['title', 'description'];
|
||||
|
||||
|
||||
/**
|
||||
* The guarded field which are not mass assignable.
|
||||
*
|
||||
|
|
|
@ -8,6 +8,6 @@ use Illuminate\Database\Eloquent\Model;
|
|||
class PageTranslation extends Model
|
||||
{
|
||||
public $timestamps = false;
|
||||
//protected $fillable = ['description'];
|
||||
protected $fillable = ['title', 'description'];
|
||||
protected $guarded = ['id'];
|
||||
}
|
||||
|
|
Loading…
Add table
editor.link_modal.header
Reference in a new issue