Commit 428b9998 authored by Nicolas Widart's avatar Nicolas Widart

Adding the entities

parent 5cd804f5
<?php namespace Modules\Menu\Entities;
use Dimsav\Translatable\Translatable;
use Illuminate\Database\Eloquent\Model;
class Menu extends Model
{
use Translatable;
protected $fillable = [
'name',
'class',
'title',
'status',
];
public $translatedAttributes = ['title', 'status'];
public function menuitems()
{
return $this->hasMany('Modules\Menu\Entities\Menuitem')->orderBy('position', 'asc');
}
}
<?php namespace Modules\Menu\Entities;
use Illuminate\Database\Eloquent\Model;
class MenuTranslation extends Model
{
protected $fillable = ['title', 'status'];
}
<?php namespace Modules\Menu\Entities;
use Baum\Node;
use Dimsav\Translatable\Translatable;
class Menuitem extends Node
{
use Translatable;
public $translatedAttributes = ['title', 'uri', 'url', 'status'];
protected $fillable = [
'menu_id',
'page_id',
'position',
'target',
'module_name',
'title',
'uri',
'url',
'status'
];
public function menu()
{
return $this->belongsTo('Modules\Menu\Entities\Menu');
}
}
<?php namespace Modules\Menu\Entities;
use Illuminate\Database\Eloquent\Model;
class MenuitemTranslation extends Model
{
public $fillable = ['title', 'uri', 'url', 'status'];
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment