27 lines
630 B
PHP
27 lines
630 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Account;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use App\Models\Favorite;
|
|
use Illuminate\Support\Facades\Auth;
|
|
|
|
class WishlistController extends Controller
|
|
{
|
|
public function index()
|
|
{
|
|
$favorites = Favorite::query()
|
|
->where('user_id', Auth::id())
|
|
->with([
|
|
'flight.departureAirport.city',
|
|
'flight.arrivalAirport.city',
|
|
'flight.file',
|
|
'tour.file',
|
|
])
|
|
->orderByDesc('id')
|
|
->paginate();
|
|
|
|
return view('account.wishlist', compact('favorites'));
|
|
}
|
|
}
|