54 lines
933 B
PHP
54 lines
933 B
PHP
<?php
|
|
|
|
/**
|
|
* Created by Reliese Model.
|
|
*/
|
|
|
|
namespace App\Models;
|
|
|
|
use Carbon\Carbon;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
/**
|
|
* Class Favorite
|
|
*
|
|
* @property int $id
|
|
* @property int $user_id
|
|
* @property int|null $tour_id
|
|
* @property int|null $flight_id
|
|
* @property Carbon|null $created_at
|
|
* @property Carbon|null $updated_at
|
|
*
|
|
* @package App\Models
|
|
*/
|
|
class Favorite extends Model
|
|
{
|
|
protected $table = 'favorites';
|
|
public static $snakeAttributes = false;
|
|
|
|
protected $casts = [
|
|
'user_id' => 'int',
|
|
'tour_id' => 'int',
|
|
'flight_id' => 'int'
|
|
];
|
|
|
|
protected $fillable = [
|
|
'user_id',
|
|
'tour_id',
|
|
'flight_id'
|
|
];
|
|
|
|
public function flight()
|
|
{
|
|
return $this->belongsTo(Flight::class, 'flight_id');
|
|
}
|
|
public function tour()
|
|
{
|
|
return $this->belongsTo(Tour::class, 'tour_id');
|
|
}
|
|
public function user()
|
|
{
|
|
return $this->belongsTo(User::class, 'user_id');
|
|
}
|
|
}
|