feat: implement favorites for tours and flights

This commit is contained in:
2026-08-18 18:38:03 +03:30
parent b1caa3fbfd
commit 7fd710bd99
7 changed files with 311 additions and 36 deletions
+14 -1
View File
@@ -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');
}
}