Add new models and page for motions

This commit is contained in:
2025-12-27 16:51:57 +01:00
parent 3ef975ad39
commit 45fe15eef2
36 changed files with 3753 additions and 355 deletions

61
app/Models/Person.php Normal file
View File

@@ -0,0 +1,61 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Person extends Model
{
protected $table = 'person';
protected $primaryKey = 'intressent_id';
protected $keyType = 'string';
public $incrementing = false;
public $timestamps = false;
protected $fillable = [
'intressent_id',
'född_år',
'kön',
'efternamn',
'tilltalsnamn',
'sorteringsnamn',
'iort',
'parti',
'valkrets',
'status',
];
public function uppdrag()
{
return $this->hasMany(PersonUppdrag::class, 'intressent_id', 'intressent_id');
}
public function uppgifter()
{
return $this->hasMany(PersonUppgift::class, 'intressent_id', 'intressent_id');
}
public function voteringar()
{
return $this->hasMany(Votering::class, 'intressent_id', 'intressent_id');
}
public function anforanden()
{
return $this->hasMany(Anforande::class, 'intressent_id', 'intressent_id');
}
public function debatter()
{
return $this->hasMany(Debatt::class, 'intressent_id', 'intressent_id');
}
public function dokIntressenter()
{
return $this->hasMany(DokIntressent::class, 'intressent_id', 'intressent_id');
}
}