Feat: Organize videos by sector

This commit is contained in:
Xavier Oliveira
2026-06-16 12:25:58 +01:00
parent c5ed77945e
commit 84e9bf7307
21 changed files with 477 additions and 116 deletions

View File

@@ -5,6 +5,7 @@ namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use App\Models\Category;
use App\Models\Sector;
class Video extends Model
{
@@ -84,4 +85,8 @@ class Video extends Model
return $this->views()->where('user_id', $user->id)->exists();
}
public function sectors()
{
return $this->belongsToMany(Sector::class, 'video_sector');
}
}