87 lines
2.9 KiB
PHP
87 lines
2.9 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Website;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use Illuminate\Http\Request;
|
|
use GuzzleHttp\Client;
|
|
use Illuminate\Support\Facades\Http;
|
|
|
|
|
|
class OurServicesController extends Controller
|
|
{
|
|
public function index(){
|
|
|
|
return view('website.pages.our_services');
|
|
}
|
|
|
|
//transform and beyond biginners
|
|
public function transform_beyond_beginner(Request $request){
|
|
|
|
// $apiKey = "bdf20639fab33d6dc265da0f6926a491";
|
|
// $ip = $request->ip(); // Get user's IP address
|
|
|
|
// $client = new Client();
|
|
// $response = $client->get("http://api.ipstack.com/{$ip}?access_key={$apiKey}");
|
|
$userIP = $request->ip(); // Get the user's IP address
|
|
|
|
// Make a GET request to ipinfo.io
|
|
$response = Http::get("https://ipinfo.io/{$userIP}/json");
|
|
// Parse the JSON response
|
|
$data = $response->json();
|
|
// $data = json_decode($response->getBody(), true);
|
|
// Get user's country code from the API response
|
|
$userCountry['data'] = $data['country'];
|
|
|
|
// dd($userCountry);
|
|
|
|
return view('website.pages.transform_beyond_beginner',$userCountry);
|
|
}
|
|
|
|
//gsf exclusive
|
|
public function gsf_exclusive(Request $request){
|
|
|
|
// $apiKey = "bdf20639fab33d6dc265da0f6926a491";
|
|
// $ip = $request->ip(); // Get user's IP address
|
|
|
|
// $client = new Client();
|
|
// $response = $client->get("http://api.ipstack.com/{$ip}?access_key={$apiKey}");
|
|
$userIP = $request->ip(); // Get the user's IP address
|
|
|
|
// Make a GET request to ipinfo.io
|
|
$response = Http::get("https://ipinfo.io/{$userIP}/json");
|
|
// Parse the JSON response
|
|
$data = $response->json();
|
|
// $data = json_decode($response->getBody(), true);
|
|
// Get user's country code from the API response
|
|
$userCountry['data'] = $data['country'];
|
|
|
|
// dd($userCountry);
|
|
|
|
return view('website.pages.gsf_exclusive',$userCountry);
|
|
}
|
|
|
|
// get set eat
|
|
public function get_set_eat(Request $request){
|
|
|
|
// $apiKey = "bdf20639fab33d6dc265da0f6926a491";
|
|
// $ip = $request->ip(); // Get user's IP address
|
|
|
|
// $client = new Client();
|
|
// $response = $client->get("http://api.ipstack.com/{$ip}?access_key={$apiKey}");
|
|
$userIP = $request->ip(); // Get the user's IP address
|
|
|
|
// Make a GET request to ipinfo.io
|
|
$response = Http::get("https://ipinfo.io/{$userIP}/json");
|
|
// Parse the JSON response
|
|
$data = $response->json();
|
|
// $data = json_decode($response->getBody(), true);
|
|
// Get user's country code from the API response
|
|
$userCountry['data'] = $data['country'];
|
|
|
|
// dd($userCountry);
|
|
|
|
return view('website.pages.get_set_eat',$userCountry);
|
|
}
|
|
}
|