fanatic/app/Models/Category.php

21 lines
385 B
PHP
Raw Normal View History

2022-04-23 16:25:16 -07:00
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Category extends Model
{
/* --------------------------------------------------------------------------- relationships ---- */
public function parent()
{
return $this->belongsTo(__CLASS__, 'parent_id');
}
public function joined()
{
return $this->morphedByMany(Joined::class, 'categorizable');
}
}