ÿØÿà JFIF H H ÿÛ C GIF89;
| System: Linux srv913213 5.15.0-190-generic #200-Ubuntu SMP Fri Aug 7 15:06:04 UTC 2026 x86_64 Current Path : /var/www/yapwebtv.com/Modules_old/Appearance/Entities/ |
| Current File : /var/www/yapwebtv.com/Modules_old/Appearance/Entities/MenuItem.php |
<?php
namespace Modules\Appearance\Entities;
use Illuminate\Database\Eloquent\Model;
class MenuItem extends Model
{
protected $fillable = [];
protected $table='menu_item';
public function menu()
{
return $this->hasOne('Modules\Appearance\Entities\Menu','id','menu_id');
}
public function parent()
{
return $this->belongsToOne(static::class, 'parent');
}
//each menu might have multiple children
public function children()
{
return $this->hasMany(static::class, 'parent')
->with('children')
->orderBy('order', 'asc');
}
public function category()
{
return $this->belongsTo('Modules\Post\Entities\Category');
}
public function subCategory()
{
return $this->belongsTo('Modules\Post\Entities\SubCategory');
}
public function page()
{
return $this->belongsTo('Modules\Page\Entities\Page');
}
public function Post()
{
return $this->belongsTo('Modules\Post\Entities\Post');
}
public function postByCategory()
{
return $this->hasMany('Modules\Post\Entities\Post', 'category_id', 'category_id')
->with('image','user')
->where('status', 1)
->orderBy('id', 'desc')
->take(4);
}
}