<?php

use Illuminate\Support\Facades\Route;
use Illuminate\Http\Request;
use App\GO\Token;

/*
|--------------------------------------------------------------------------
| 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 () {
    return view('danoral');
});

Route::domain('go.danoral.com')->group(function () {

    Route::get('/{token}', function (Request $request, string $token) {

        $req = [
            'token'             => $token,
            'ipAddress'         => $request->ip(),
            'ipAddresses'       => $request->ips()
        ];

        return Token::getGO($req);

    });

});

//etc...
Route::get('dano-logo', function () {
    return view('danoral');
});

Route::get('hoja-cuadricula', function () {
    return view('cuadricula', ['filas' => 60, 'columnas' => 40]);
});





