38 lines
832 B
PHP
38 lines
832 B
PHP
<?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);
|
|
}
|
|
}
|