mirror of
https://github.com/Einundzwanzig-Podcast/einundzwanzig-portal.git
synced 2025-12-11 06:46:47 +00:00
add tags
This commit is contained in:
@@ -8,11 +8,13 @@ use Spatie\Image\Manipulations;
|
||||
use Spatie\MediaLibrary\HasMedia;
|
||||
use Spatie\MediaLibrary\InteractsWithMedia;
|
||||
use Spatie\MediaLibrary\MediaCollections\Models\Media;
|
||||
use Spatie\Tags\HasTags;
|
||||
|
||||
class Course extends Model implements HasMedia
|
||||
{
|
||||
use HasFactory;
|
||||
use InteractsWithMedia;
|
||||
use HasTags;
|
||||
|
||||
/**
|
||||
* The attributes that aren't mass assignable.
|
||||
|
||||
11
app/Models/Tag.php
Normal file
11
app/Models/Tag.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class Tag extends \Spatie\Tags\Tag
|
||||
{
|
||||
public function courses()
|
||||
{
|
||||
return $this->morphedByMany(Course::class, 'taggable');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user