fedi-feed-router/app/Models/Language.php
myrmidex 6784af2ff6
Some checks failed
CI / ci (push) Failing after 4m31s
25 - Fix all PHPStan errors and add mockery extension
2026-03-08 14:18:28 +01:00

52 lines
1.2 KiB
PHP

<?php
namespace App\Models;
use Database\Factories\LanguageFactory;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Database\Eloquent\Relations\HasMany;
class Language extends Model
{
/** @use HasFactory<LanguageFactory> */
use HasFactory;
protected $fillable = [
'short_code',
'name',
'native_name',
'is_active',
];
protected $casts = [
'is_active' => 'boolean',
];
/**
* @return BelongsToMany<PlatformInstance, $this>
*/
public function platformInstances(): BelongsToMany
{
return $this->belongsToMany(PlatformInstance::class)
->withPivot(['platform_language_id', 'is_default'])
->withTimestamps();
}
/**
* @return HasMany<PlatformChannel, $this>
*/
public function platformChannels(): HasMany
{
return $this->hasMany(PlatformChannel::class);
}
/**
* @return HasMany<Feed, $this>
*/
public function feeds(): HasMany
{
return $this->hasMany(Feed::class);
}
}