2024-08-09 17:11:41 +05:30
|
|
|
<?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(){
|
2024-08-29 13:26:35 +05:30
|
|
|
|
2024-08-09 17:11:41 +05:30
|
|
|
return view('website.pages.our_services');
|
|
|
|
|
}
|
2024-08-29 13:26:35 +05:30
|
|
|
|
2024-08-09 17:11:41 +05:30
|
|
|
//transform and beyond biginners
|
|
|
|
|
public function transform_beyond_beginner(Request $request){
|
2024-08-29 13:26:35 +05:30
|
|
|
|
2024-08-09 17:11:41 +05:30
|
|
|
// $apiKey = "bdf20639fab33d6dc265da0f6926a491";
|
|
|
|
|
// $ip = $request->ip(); // Get user's IP address
|
2024-08-29 13:26:35 +05:30
|
|
|
|
2024-08-09 17:11:41 +05:30
|
|
|
// $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
|
2024-08-29 13:26:35 +05:30
|
|
|
// $response = Http::get("https://ipinfo.io/{$userIP}/json");
|
2024-08-09 17:11:41 +05:30
|
|
|
// Parse the JSON response
|
2024-08-29 13:26:35 +05:30
|
|
|
// $data = $response->json();
|
2024-08-09 17:11:41 +05:30
|
|
|
// $data = json_decode($response->getBody(), true);
|
|
|
|
|
// Get user's country code from the API response
|
2024-08-29 13:26:35 +05:30
|
|
|
// $userCountry['data'] = $data['country'];
|
|
|
|
|
|
|
|
|
|
$response = Http::get("http://ip-api.com/json/{$userIP}");
|
|
|
|
|
|
|
|
|
|
// Convert the response to an array
|
|
|
|
|
$data = $response->json();
|
|
|
|
|
|
|
|
|
|
// Check if the status in the response is 'success'
|
|
|
|
|
if ($data['status'] === 'success') {
|
|
|
|
|
// Process the data as needed
|
|
|
|
|
$userCountry['data'] = $data['countryCode'];
|
|
|
|
|
} else {
|
|
|
|
|
$userCountry['data'] = "";
|
|
|
|
|
}
|
|
|
|
|
|
2024-08-09 17:11:41 +05:30
|
|
|
// dd($userCountry);
|
2024-08-29 13:26:35 +05:30
|
|
|
|
2024-08-09 17:11:41 +05:30
|
|
|
return view('website.pages.transform_beyond_beginner',$userCountry);
|
|
|
|
|
}
|
2024-08-29 13:26:35 +05:30
|
|
|
|
2024-08-09 17:11:41 +05:30
|
|
|
//gsf exclusive
|
|
|
|
|
public function gsf_exclusive(Request $request){
|
2024-08-29 13:26:35 +05:30
|
|
|
|
2024-08-09 17:11:41 +05:30
|
|
|
// $apiKey = "bdf20639fab33d6dc265da0f6926a491";
|
|
|
|
|
// $ip = $request->ip(); // Get user's IP address
|
2024-08-29 13:26:35 +05:30
|
|
|
|
2024-08-09 17:11:41 +05:30
|
|
|
// $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
|
2024-08-29 13:26:35 +05:30
|
|
|
// $response = Http::get("https://ipinfo.io/{$userIP}/json");
|
2024-08-09 17:11:41 +05:30
|
|
|
// Parse the JSON response
|
2024-08-29 13:26:35 +05:30
|
|
|
// $data = $response->json();
|
2024-08-09 17:11:41 +05:30
|
|
|
// $data = json_decode($response->getBody(), true);
|
|
|
|
|
// Get user's country code from the API response
|
2024-08-29 13:26:35 +05:30
|
|
|
// $userCountry['data'] = $data['country'];
|
|
|
|
|
|
|
|
|
|
$response = Http::get("http://ip-api.com/json/{$userIP}");
|
|
|
|
|
|
|
|
|
|
// Convert the response to an array
|
|
|
|
|
$data = $response->json();
|
|
|
|
|
|
|
|
|
|
// Check if the status in the response is 'success'
|
|
|
|
|
if ($data['status'] === 'success') {
|
|
|
|
|
// Process the data as needed
|
|
|
|
|
$userCountry['data'] = $data['countryCode'];
|
|
|
|
|
} else {
|
|
|
|
|
$userCountry['data'] = "";
|
|
|
|
|
}
|
|
|
|
|
|
2024-08-09 17:11:41 +05:30
|
|
|
// dd($userCountry);
|
2024-08-29 13:26:35 +05:30
|
|
|
|
2024-08-09 17:11:41 +05:30
|
|
|
return view('website.pages.gsf_exclusive',$userCountry);
|
|
|
|
|
}
|
2024-08-29 13:26:35 +05:30
|
|
|
|
2024-08-09 17:11:41 +05:30
|
|
|
// get set eat
|
|
|
|
|
public function get_set_eat(Request $request){
|
2024-08-29 13:26:35 +05:30
|
|
|
|
2024-08-09 17:11:41 +05:30
|
|
|
// $apiKey = "bdf20639fab33d6dc265da0f6926a491";
|
|
|
|
|
// $ip = $request->ip(); // Get user's IP address
|
2024-08-29 13:26:35 +05:30
|
|
|
|
2024-08-09 17:11:41 +05:30
|
|
|
// $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
|
2024-08-29 13:26:35 +05:30
|
|
|
// $response = Http::get("https://ipinfo.io/{$userIP}/json");
|
2024-08-09 17:11:41 +05:30
|
|
|
// Parse the JSON response
|
2024-08-29 13:26:35 +05:30
|
|
|
// $data = $response->json();
|
2024-08-09 17:11:41 +05:30
|
|
|
// $data = json_decode($response->getBody(), true);
|
|
|
|
|
// Get user's country code from the API response
|
2024-08-29 13:26:35 +05:30
|
|
|
// $userCountry['data'] = $data['country'];
|
|
|
|
|
|
|
|
|
|
$response = Http::get("http://ip-api.com/json/{$userIP}");
|
|
|
|
|
|
|
|
|
|
// Convert the response to an array
|
|
|
|
|
$data = $response->json();
|
|
|
|
|
|
|
|
|
|
// Check if the status in the response is 'success'
|
|
|
|
|
if ($data['status'] === 'success') {
|
|
|
|
|
// Process the data as needed
|
|
|
|
|
$userCountry['data'] = $data['countryCode'];
|
|
|
|
|
} else {
|
|
|
|
|
$userCountry['data'] = "";
|
|
|
|
|
}
|
|
|
|
|
|
2024-08-09 17:11:41 +05:30
|
|
|
// dd($userCountry);
|
2024-08-29 13:26:35 +05:30
|
|
|
|
2024-08-09 17:11:41 +05:30
|
|
|
return view('website.pages.get_set_eat',$userCountry);
|
|
|
|
|
}
|
|
|
|
|
}
|