28 lines
513 B
PHP
28 lines
513 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Models;
|
||
|
|
|
||
|
|
use Illuminate\Database\Eloquent\Model;
|
||
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||
|
|
|
||
|
|
class Trip extends Model
|
||
|
|
{
|
||
|
|
protected $fillable = [
|
||
|
|
'name',
|
||
|
|
'description',
|
||
|
|
'start_date',
|
||
|
|
'end_date',
|
||
|
|
'created_by_user_id'
|
||
|
|
];
|
||
|
|
|
||
|
|
protected $casts = [
|
||
|
|
'start_date' => 'date',
|
||
|
|
'end_date' => 'date',
|
||
|
|
];
|
||
|
|
|
||
|
|
public function user(): BelongsTo
|
||
|
|
{
|
||
|
|
return $this->belongsTo(User::class, 'created_by_user_id');
|
||
|
|
}
|
||
|
|
}
|