diff --git a/app/Http/Controllers/Account/FavoriteController.php b/app/Http/Controllers/Account/FavoriteController.php new file mode 100644 index 0000000..a8d6550 --- /dev/null +++ b/app/Http/Controllers/Account/FavoriteController.php @@ -0,0 +1,35 @@ + 'int', + 'tour_id' => 'int', + 'flight_id' => 'int' + ]; + + protected $fillable = [ + 'user_id', + 'tour_id', + 'flight_id' + ]; +} diff --git a/app/Models/Flight.php b/app/Models/Flight.php index ac79abf..e00a439 100644 --- a/app/Models/Flight.php +++ b/app/Models/Flight.php @@ -150,5 +150,9 @@ class Flight extends Model { return $this->hasMany(Comment::class, 'flight_id'); } + public function favorites() + { + return $this->hasMany(Favorite::class); + } } diff --git a/app/Models/Tour.php b/app/Models/Tour.php index 0b322d8..b432d52 100644 --- a/app/Models/Tour.php +++ b/app/Models/Tour.php @@ -100,4 +100,8 @@ class Tour extends Model { return $this->hasMany(Comment::class, 'tour_id'); } + public function favorites() + { + return $this->hasMany(Favorite::class); + } } diff --git a/app/Models/User.php b/app/Models/User.php index 9f8d6b0..27f9898 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -108,4 +108,8 @@ class User extends Authenticate { return $this->hasMany(Comment::class, 'user_id'); } + public function favorites() + { + return $this->hasMany(Favorite::class); + } } diff --git a/resources/views/account/layouts/sidebar.blade.php b/resources/views/account/layouts/sidebar.blade.php index 18b70ae..020a51e 100644 --- a/resources/views/account/layouts/sidebar.blade.php +++ b/resources/views/account/layouts/sidebar.blade.php @@ -11,7 +11,7 @@