%PDF- %PDF-
Direktori : /var/www/html/digiprint/app/Models/ |
Current File : /var/www/html/digiprint/app/Models/Category.php |
<?php namespace Digiprint\Models; class Category extends BaseModel { /** * The attributes that are mass assignable. * * @var array */ protected $fillable = [ 'name', 'slug', 'short_description', 'description', 'order', ]; protected $guarded = [ 'parent_id', ]; public function parent() { return $this->belongsTo(self::class); } public function subcategories() { return $this->hasMany(self::class, 'parent_id'); } /** * @return \Illuminate\Database\Eloquent\Relations\MorphMany */ public function media() { return $this->morphMany(Media::class, 'model'); } }