Files
sogandAsghary.Project09/app/Models/Wishlist.php
T

60 lines
956 B
PHP

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