Initial commit

This commit is contained in:
Ronald Huynen
2026-03-23 21:37:59 +01:00
commit 2547717edb
2193 changed files with 972171 additions and 0 deletions

44
app/Models/Language.php Normal file
View File

@@ -0,0 +1,44 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Language extends Model
{
use HasFactory;
protected $fillable = [
'name',
'lang_code',
'flag'
];
/**
* Get all users that are assigned to this language.
*/
public function users()
{
return $this->morphedByMany(User::class, 'languagable');
}
/**
* Get all organizations that are assigned to this language.
*/
public function organizations()
{
return $this->morphedByMany(Organization::class, 'languagable');
}
/**
* Get all posts that are assigned to this language.
*/
public function posts()
{
return $this->morphedByMany(Post::class, 'languagable');
}
}