30 lines
631 B
PHP
30 lines
631 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class WheelchairTransaction extends Model
|
|
{
|
|
protected $guarded = [];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'taken_at' => 'datetime',
|
|
'returned_at' => 'datetime',
|
|
];
|
|
}
|
|
|
|
public function allocation(): BelongsTo
|
|
{
|
|
return $this->belongsTo(WheelchairAllocation::class, 'wheelchair_allocation_id');
|
|
}
|
|
|
|
public function recordedBy(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class, 'recorded_by_user_id');
|
|
}
|
|
}
|