fedi-feed-router/app/Models/Language.php

39 lines
832 B
PHP
Raw Normal View History

2025-07-05 18:26:04 +02:00
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Database\Eloquent\Relations\HasMany;
class Language extends Model
{
protected $fillable = [
'short_code',
'name',
'native_name',
'is_active'
];
protected $casts = [
'is_active' => 'boolean'
];
public function platformInstances(): BelongsToMany
{
return $this->belongsToMany(PlatformInstance::class)
->withPivot(['platform_language_id', 'is_default'])
->withTimestamps();
}
public function platformChannels(): HasMany
{
return $this->hasMany(PlatformChannel::class);
}
public function feeds(): HasMany
{
return $this->hasMany(Feed::class);
}
}