*/ use HasFactory; protected $fillable = [ 'platform', 'url', 'name', 'description', 'is_active' ]; protected $casts = [ 'platform' => PlatformEnum::class, 'is_active' => 'boolean' ]; public function channels(): HasMany { return $this->hasMany(PlatformChannel::class); } public function languages(): BelongsToMany { return $this->belongsToMany(Language::class) ->withPivot(['platform_language_id', 'is_default']) ->withTimestamps(); } public static function findByUrl(PlatformEnum $platform, string $url): ?self { return static::where('platform', $platform) ->where('url', $url) ->first(); } }