%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /var/www/html/news/app/Models/
Upload File :
Create Path :
Current File : /var/www/html/news/app/Models/Menu.php

<?php

namespace App\Models;

use App\Presenters\MenuPresenter;
use Laracodes\Presenter\Traits\Presentable;

class Menu extends BaseModel
{
    use Presentable;

    protected $presenter = MenuPresenter::class;

    protected $fillable = [
        'name',
        'url',
        'parent_id',
        'category_id',
    ];

    protected $casts = [
        'id'   => 'integer',
        'name' => 'string',
        'url'  => 'string',
    ];

    protected $dates = [

    ];

    public function children()
    {
        return $this->hasMany(Menu::class, 'parent_id');
    }

    public function category()
    {
        return $this->belongsTo(Category::class, 'category_id');
    }

}

Zerion Mini Shell 1.0