feat: implement favorites for tours and flights
This commit is contained in:
+14
-1
@@ -11,7 +11,7 @@ use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class Favorite
|
||||
*
|
||||
*
|
||||
* @property int $id
|
||||
* @property int $user_id
|
||||
* @property int|null $tour_id
|
||||
@@ -37,4 +37,17 @@ class Favorite extends Model
|
||||
'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');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user