translateable cms pages
This commit is contained in:
parent
ee8584a2d5
commit
0457e65565
8 changed files with 244 additions and 10 deletions
|
@ -5,10 +5,12 @@ namespace App\Models;
|
|||
use App\Models\ModelTrait;
|
||||
use App\Models\User;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Dimsav\Translatable\Translatable;
|
||||
|
||||
class Page extends Model
|
||||
{
|
||||
use ModelTrait;
|
||||
use Translatable;
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
|
@ -16,6 +18,8 @@ class Page extends Model
|
|||
*/
|
||||
protected $table;
|
||||
|
||||
public $translatedAttributes = ['title', 'description'];
|
||||
|
||||
/**
|
||||
* The guarded field which are not mass assignable.
|
||||
*
|
||||
|
@ -40,6 +44,7 @@ class Page extends Model
|
|||
{
|
||||
parent::__construct($attributes);
|
||||
$this->table = 'pages'; //config('module.pages.table');
|
||||
// $this->defaultLocale = 'de';
|
||||
}
|
||||
|
||||
public function owner()
|
||||
|
|
13
app/Models/PageTranslation.php
Normal file
13
app/Models/PageTranslation.php
Normal file
|
@ -0,0 +1,13 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
// models/CountryTranslation.php
|
||||
class PageTranslation extends Model
|
||||
{
|
||||
public $timestamps = false;
|
||||
//protected $fillable = ['description'];
|
||||
protected $guarded = ['id'];
|
||||
}
|
Loading…
Add table
editor.link_modal.header
Reference in a new issue