+ Add helper route for Google Geocoding
This commit is contained in:
parent
881795c2eb
commit
e17ff1ad48
|
@ -27,3 +27,5 @@ WALLET_SERVICE_KEY=yhSTSSqIO1uSE1icu09edPOeSFGxIDjo
|
||||||
NOTIFICATION_SERVICE_NAME = notificationService
|
NOTIFICATION_SERVICE_NAME = notificationService
|
||||||
NOTIFICATION_SERVICE_BASE_URL= http://localhost:8083
|
NOTIFICATION_SERVICE_BASE_URL= http://localhost:8083
|
||||||
NOTIFICATION_SERVICE_KEY=RfXvPQzQRgwpzQYPnLfWpZzgx4QseHlg
|
NOTIFICATION_SERVICE_KEY=RfXvPQzQRgwpzQYPnLfWpZzgx4QseHlg
|
||||||
|
|
||||||
|
GOOGLE_GEOCODING_API_KEY=AIzaSyAixFlmxSD_IM_X3jaRn0OyhfZK3xJSAAk
|
||||||
|
|
|
@ -0,0 +1,36 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
use GuzzleHttp\Client;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
|
||||||
|
class HelperController extends Controller
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Create a new controller instance.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
public function getGoogleGeocoding(Request $request)
|
||||||
|
{
|
||||||
|
|
||||||
|
$latitude = $request->input('latitude');
|
||||||
|
$longitude = $request->input('longitude');
|
||||||
|
|
||||||
|
$client = new Client();
|
||||||
|
|
||||||
|
$URL = "https://maps.googleapis.com/maps/api/geocode/json";
|
||||||
|
|
||||||
|
$response = $client->request('GET', $URL, ['query' => ['latlng' => $latitude . ',' . $longitude, 'key' => env('GOOGLE_GEOCODING_API_KEY')]]);
|
||||||
|
|
||||||
|
return $response->getBody()->getContents();
|
||||||
|
}
|
||||||
|
}
|
|
@ -24,6 +24,7 @@ use Illuminate\Support\Facades\Hash;
|
||||||
* @property string $phone
|
* @property string $phone
|
||||||
* @property string $encrypted_password
|
* @property string $encrypted_password
|
||||||
* @property string $salt
|
* @property string $salt
|
||||||
|
* @property string $type
|
||||||
|
|
||||||
*
|
*
|
||||||
* @package App\Models
|
* @package App\Models
|
||||||
|
@ -45,6 +46,7 @@ class UsersCredentials extends Model implements AuthenticatableContract, Authori
|
||||||
'phone',
|
'phone',
|
||||||
'encrypted_password',
|
'encrypted_password',
|
||||||
'salt',
|
'salt',
|
||||||
|
'type'
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -10,7 +10,10 @@
|
||||||
| and give it the Closure to call when that URI is requested.
|
| and give it the Closure to call when that URI is requested.
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
|
/*
|
||||||
|
* Helpers routes
|
||||||
|
*/
|
||||||
|
$router->get('/geocode', 'HelperController@getGoogleGeocoding');
|
||||||
//$router->get('/', function () use ($router) {
|
//$router->get('/', function () use ($router) {
|
||||||
// return $router->app->version();
|
// return $router->app->version();
|
||||||
//});
|
//});
|
||||||
|
@ -107,10 +110,10 @@
|
||||||
|
|
||||||
//Les historiques globals des hyperviseur et superviseur
|
//Les historiques globals des hyperviseur et superviseur
|
||||||
$router->get('hyper_history/{id_network}', 'WalletServiceController@get');
|
$router->get('hyper_history/{id_network}', 'WalletServiceController@get');
|
||||||
$router->get('super_history/{id_wallet}', 'WalletServiceController@get');
|
$router->get('super_history/{agent_code}', 'WalletServiceController@get');
|
||||||
// Routes sans pagination
|
// Routes sans pagination
|
||||||
$router->get('all_hyper_history/{id_network}', 'WalletServiceController@get');
|
$router->get('all_hyper_history/{id_network}', 'WalletServiceController@get');
|
||||||
$router->get('all_super_history/{id_wallet}', 'WalletServiceController@get');
|
$router->get('all_super_history/{agent_code}', 'WalletServiceController@get');
|
||||||
|
|
||||||
// Wallets users iLink
|
// Wallets users iLink
|
||||||
$router->group(['prefix' => '/users'] , function () use ($router){
|
$router->group(['prefix' => '/users'] , function () use ($router){
|
||||||
|
|
Loading…
Reference in New Issue