29 lines
588 B
PHP
29 lines
588 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Concerns\HasUlids;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Payment extends Model
|
|
{
|
|
use HasUlids;
|
|
|
|
protected $fillable = ['booking_id', 'user_id', 'amount', 'provider', 'reference', 'status', 'paid_at', 'notes'];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return ['amount' => 'decimal:2', 'paid_at' => 'datetime'];
|
|
}
|
|
|
|
public function booking()
|
|
{
|
|
return $this->belongsTo(Booking::class);
|
|
}
|
|
|
|
public function user()
|
|
{
|
|
return $this->belongsTo(User::class);
|
|
}
|
|
}
|