Initial commit
This commit is contained in:
commit
f7e6810eda
87 changed files with 11411 additions and 0 deletions
31
routes/web.php
Normal file
31
routes/web.php
Normal file
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use GuzzleHttp\Client;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Web Routes
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here is where you can register web routes for your application. These
|
||||
| routes are loaded by the RouteServiceProvider within a group which
|
||||
| contains the "web" middleware group. Now create something great!
|
||||
|
|
||||
*/
|
||||
|
||||
Route::get('/', function () {
|
||||
$client = new Client([
|
||||
'base_uri' => 'https://app.wayward.travel/',
|
||||
'timeout' => 3.0
|
||||
]);
|
||||
|
||||
$response = $client->get('trip/q0mwldvenxq09p2x18nj/user/zmld8ko6qy7d9j3xvq10/json');
|
||||
|
||||
if ($response->getStatusCode() == 200) {
|
||||
$data = json_decode($response->getBody());
|
||||
return view('tracker', ['trip' => $data->trip]);
|
||||
} else {
|
||||
return 'Something went wrong';
|
||||
}
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue