3 namespace BookStack\Entities\Models;
5 use BookStack\App\Model;
6 use BookStack\Permissions\Models\JointPermission;
7 use Illuminate\Database\Eloquent\Factories\HasFactory;
8 use Illuminate\Database\Eloquent\Relations\HasMany;
12 * @property int $sluggable_id
13 * @property string $sluggable_type
14 * @property string $slug
15 * @property ?string $parent_slug
17 class SlugHistory extends Model
21 protected $table = 'slug_history';
23 public function jointPermissions(): HasMany
25 return $this->hasMany(JointPermission::class, 'entity_id', 'sluggable_id')
26 ->whereColumn('joint_permissions.entity_type', '=', 'slug_history.sluggable_type');