Add new models and page for motions
This commit is contained in:
44
app/Models/PersonUppdrag.php
Normal file
44
app/Models/PersonUppdrag.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class PersonUppdrag extends Model
|
||||
{
|
||||
protected $table = 'personuppdrag';
|
||||
|
||||
public $timestamps = false;
|
||||
|
||||
protected $fillable = [
|
||||
'intressent_id',
|
||||
'organ_kod',
|
||||
'roll_kod',
|
||||
'ordningsnummer',
|
||||
'status',
|
||||
'typ',
|
||||
'from',
|
||||
'tom',
|
||||
'uppgift',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'from' => 'datetime',
|
||||
'tom' => 'datetime',
|
||||
];
|
||||
|
||||
public function person()
|
||||
{
|
||||
return $this->belongsTo(Person::class, 'intressent_id', 'intressent_id');
|
||||
}
|
||||
|
||||
public function organ()
|
||||
{
|
||||
return $this->belongsTo(Organ::class, 'organ_kod', 'kod');
|
||||
}
|
||||
|
||||
public function roll()
|
||||
{
|
||||
return $this->belongsTo(Roll::class, 'roll_kod', 'kod');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user