Download app/Models/Common/Menu.php from pnacorp/magicai: direct link, hf CLI and curl.
- Browser
- Download file 1.08 kB
-
https://huggingface.co/pnacorp/magicai/resolve/main/app/Models/Common/Menu.php
- Command line
-
hf download hf://pnacorp/magicai/app/Models/Common/Menu.php
-
curl -L -o Menu.php https://huggingface.co/pnacorp/magicai/resolve/main/app/Models/Common/Menu.php
1.08 kB
| namespace App\Models\Common; | |
| use Illuminate\Database\Eloquent\Model; | |
| use Illuminate\Database\Eloquent\Relations\BelongsTo; | |
| use Illuminate\Database\Eloquent\Relations\HasMany; | |
| class Menu extends Model | |
| { | |
| protected $fillable = [ | |
| 'parent_id', | |
| 'key', | |
| 'route', | |
| 'route_slug', | |
| 'label', | |
| 'icon', | |
| 'svg', | |
| 'order', | |
| 'is_active', | |
| 'params', | |
| 'type', | |
| 'extension', | |
| 'letter_icon', | |
| 'letter_icon_bg', | |
| 'custom_menu', | |
| ]; | |
| protected $casts = [ | |
| 'is_active' => 'boolean', | |
| 'params' => 'array', | |
| ]; | |
| public function parent(): BelongsTo | |
| { | |
| return $this->belongsTo(Menu::class, 'parent_id'); | |
| } | |
| public function children(): HasMany | |
| { | |
| return $this->hasMany(Menu::class, 'parent_id')->orderBy('order'); | |
| } | |
| public function scopeActive($query) | |
| { | |
| return $query->where('is_active', true); | |
| } | |
| public function scopeParent($query) | |
| { | |
| return $query->whereNull('parent_id'); | |
| } | |
| } | |