namespace App\Http\Controllers; use Illuminate\Http\Request; use GuzzleHttp\Client; class HotelController extends Controller { public function index() { return view('hotels.index'); // Load the hotel search page } public function search(Request $request) { $location = $request->input('location'); $checkIn = $request->input('check_in'); $checkOut = $request->input('check_out'); // Example API Call $client = new Client(); $response = $client->request('GET', 'https://api.trivago.com/example-endpoint', [ 'query' => [ 'location' => $location, 'check_in' => $checkIn, 'check_out' => $checkOut, 'api_key' => env('TRIVAGO_API_KEY') // Store API key in .env ] ]); $hotels = json_decode($response->getBody()->getContents(), true); return view('hotels.results', compact('hotels')); } } namespace App\Http\Controllers; use Illuminate\Http\Request; use GuzzleHttp\Client; class HotelController extends Controller { public function index() { return view('hotels.index'); // Load the hotel search page } public function search(Request $request) { $location = $request->input('location'); $checkIn = $request->input('check_in'); $checkOut = $request->input('check_out'); // Example API Call $client = new Client(); $response = $client->request('GET', 'https://api.trivago.com/example-endpoint', [ 'query' => [ 'location' => $location, 'check_in' => $checkIn, 'check_out' => $checkOut, 'api_key' => env('TRIVAGO_API_KEY') // Store API key in .env ] ]); $hotels = json_decode($response->getBody()->getContents(), true); return view('hotels.results', compact('hotels')); } } namespace App\Http\Controllers; use Illuminate\Http\Request; use GuzzleHttp\Client; class HotelController extends Controller { public function index() { return view('hotels.index'); // Load the hotel search page } public function search(Request $request) { $location = $request->input('location'); $checkIn = $request->input('check_in'); $checkOut = $request->input('check_out'); // Example API Call $client = new Client(); $response = $client->request('GET', 'https://api.trivago.com/example-endpoint', [ 'query' => [ 'location' => $location, 'check_in' => $checkIn, 'check_out' => $checkOut, 'api_key' => env('TRIVAGO_API_KEY') // Store API key in .env ] ]); $hotels = json_decode($response->getBody()->getContents(), true); return view('hotels.results', compact('hotels')); } } namespace App\Http\Controllers; use Illuminate\Http\Request; use GuzzleHttp\Client; class HotelController extends Controller { public function index() { return view('hotels.index'); // Load the hotel search page } public function search(Request $request) { $location = $request->input('location'); $checkIn = $request->input('check_in'); $checkOut = $request->input('check_out'); // Example API Call $client = new Client(); $response = $client->request('GET', 'https://api.trivago.com/example-endpoint', [ 'query' => [ 'location' => $location, 'check_in' => $checkIn, 'check_out' => $checkOut, 'api_key' => env('TRIVAGO_API_KEY') // Store API key in .env ] ]); $hotels = json_decode($response->getBody()->getContents(), true); return view('hotels.results', compact('hotels')); } } namespace App\Http\Controllers; use Illuminate\Http\Request; use GuzzleHttp\Client; class HotelController extends Controller { public function index() { return view('hotels.index'); // Load the hotel search page } public function search(Request $request) { $location = $request->input('location'); $checkIn = $request->input('check_in'); $checkOut = $request->input('check_out'); // Example API Call $client = new Client(); $response = $client->request('GET', 'https://api.trivago.com/example-endpoint', [ 'query' => [ 'location' => $location, 'check_in' => $checkIn, 'check_out' => $checkOut, 'api_key' => env('TRIVAGO_API_KEY') // Store API key in .env ] ]); $hotels = json_decode($response->getBody()->getContents(), true); return view('hotels.results', compact('hotels')); } }