61 lines
974 B
PHP
61 lines
974 B
PHP
<?php
|
|
|
|
/**
|
|
* Created by Reliese Model.
|
|
*/
|
|
|
|
namespace App\Models;
|
|
|
|
use Carbon\Carbon;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
/**
|
|
* Class Reservation
|
|
*
|
|
* @property int $id
|
|
* @property int $user_id
|
|
* @property int $reservable_id
|
|
* @property string $reservable_type
|
|
* @property float $price
|
|
* @property string $status
|
|
* @property Carbon $created_at
|
|
* @property Carbon $updated_at
|
|
*
|
|
* @package App\Models
|
|
*/
|
|
class Reservation extends Model
|
|
{
|
|
protected $table = 'reservations';
|
|
|
|
public static $snakeAttributes = false;
|
|
|
|
|
|
protected $casts = [
|
|
'user_id' => 'int',
|
|
'reservable_id' => 'int',
|
|
'price' => 'float',
|
|
];
|
|
|
|
|
|
protected $fillable = [
|
|
'user_id',
|
|
'reservable_id',
|
|
'reservable_type',
|
|
'price',
|
|
'status'
|
|
];
|
|
|
|
|
|
public function user()
|
|
{
|
|
return $this->belongsTo(User::class);
|
|
}
|
|
|
|
|
|
public function reservable()
|
|
{
|
|
return $this->morphTo();
|
|
}
|
|
|
|
}
|