35 lines
740 B
PHP
35 lines
740 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
|
|
class Migration extends Model
|
|
{
|
|
use HasFactory, SoftDeletes;
|
|
|
|
protected $table = 'migration';
|
|
protected $primaryKey = 'migration_id';
|
|
|
|
protected $fillable = [
|
|
'person_id',
|
|
'date_of_arrival_aus',
|
|
'date_of_arrival_nt',
|
|
'arrival_period',
|
|
'data_source',
|
|
];
|
|
|
|
protected $casts = [
|
|
'date_of_arrival_aus' => 'date',
|
|
'date_of_arrival_nt' => 'date',
|
|
];
|
|
|
|
// Relationship
|
|
public function person()
|
|
{
|
|
return $this->belongsTo(Person::class, 'person_id');
|
|
}
|
|
}
|