42 lines
789 B
PHP
42 lines
789 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class DangerPointAccident extends Model
|
|
{
|
|
/**
|
|
* The attributes that are mass assignable.
|
|
*
|
|
* @var array
|
|
*/
|
|
protected $fillable = [
|
|
'user_id',
|
|
'serial_number',
|
|
'accident_date',
|
|
'day',
|
|
'time',
|
|
'accident_direction',
|
|
'collision_type',
|
|
'accident_factors',
|
|
'accident_type',
|
|
'accident_result'
|
|
];
|
|
|
|
/**
|
|
* The attributes that should be cast to native types.
|
|
*
|
|
* @var array
|
|
*/
|
|
protected $casts = [
|
|
'accident_factors' => 'array',
|
|
'accident_result' => 'array'
|
|
];
|
|
|
|
public function dangerPoint()
|
|
{
|
|
return $this->belongsTo('App\Models\DangerPoint');
|
|
}
|
|
}
|