fix: update admin tour management

This commit is contained in:
2026-08-20 08:17:05 +03:30
parent ccee91fdc4
commit 66cc0d64ad
2 changed files with 401 additions and 48 deletions
+12 -1
View File
@@ -2,6 +2,7 @@
namespace App\Http\Controllers;
use App\Models\Favorite;
use App\Models\Tour;
use App\Models\TravelType;
use Illuminate\Http\Request;
@@ -113,9 +114,19 @@ class TourController extends Controller
->limit(4)
->get();
$isFav = false;
if (auth()->check()) {
$isFav = Favorite::where('user_id', auth()->id())
->where('favoritable_type', Tour::class)
->where('favoritable_id', $tour->id)
->exists();
}
return view(
'tours.show',
compact('tour', 'relatedTours')
compact('tour', 'relatedTours', 'isFav')
);
}