38 lines
804 B
PHP
38 lines
804 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
|
|
class Residence extends Model
|
|
{
|
|
use HasFactory, SoftDeletes;
|
|
|
|
protected $table = 'residence';
|
|
protected $primaryKey = 'residence_id';
|
|
|
|
protected $fillable = [
|
|
'person_id',
|
|
'darwin',
|
|
'katherine',
|
|
'tennant_creek',
|
|
'alice_springs',
|
|
'home_at_death',
|
|
];
|
|
|
|
protected $casts = [
|
|
'darwin' => 'boolean',
|
|
'katherine' => 'boolean',
|
|
'tennant_creek' => 'boolean',
|
|
'alice_springs' => 'boolean',
|
|
];
|
|
|
|
// Relationship
|
|
public function person()
|
|
{
|
|
return $this->belongsTo(Person::class, 'person_id');
|
|
}
|
|
}
|