2024-05-24 23:48:23 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
|
|
use Illuminate\Database\Eloquent\Relations\HasOne;
|
2024-05-29 21:07:23 +00:00
|
|
|
use Illuminate\Database\Eloquent\Relations\Pivot;
|
2024-05-24 23:48:23 +00:00
|
|
|
|
2024-05-29 21:07:23 +00:00
|
|
|
class BookmarkTag extends Pivot
|
2024-05-24 23:48:23 +00:00
|
|
|
{
|
|
|
|
use HasFactory;
|
|
|
|
|
|
|
|
public function parent()
|
|
|
|
{
|
|
|
|
return $this->belongsTo(Bookmark::class, 'bookmark_id');
|
|
|
|
}
|
|
|
|
|
|
|
|
public function tag(): HasOne
|
|
|
|
{
|
|
|
|
return $this->hasOne(Tag::class, 'id', 'tag_id');
|
|
|
|
}
|
|
|
|
}
|