mirror of
https://github.com/Einundzwanzig-Podcast/einundzwanzig-portal.git
synced 2025-12-11 06:46:47 +00:00
library items parent_id
This commit is contained in:
@@ -6,6 +6,7 @@ use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
class Library extends Model
|
||||
{
|
||||
@@ -44,4 +45,9 @@ class Library extends Model
|
||||
{
|
||||
return $this->belongsToMany(LibraryItem::class);
|
||||
}
|
||||
|
||||
public function parent() : BelongsTo
|
||||
{
|
||||
return $this->belongsTo(__CLASS__, 'parent_id');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user