Showing paste #KlNm:

<?php

// Routes
Route::get('/', function () {
    return view('welcome');
});

Route::get('/request1', function () {
    return '{"message": "request1"}';
});

Route::get('/request2', function () {
    return '{"message": "request2"}';
});

?>
<!DOCTYPE html>
<html>
    <head>
        <title>Laravel</title>
    </head>
    <body>
        <script>
            async function makeRequest(url) {
                const promise = await fetch(url)
                console.log(await promise.json())
            }

            makeRequest('<?= env('APP_URL') ?>/request1')
            makeRequest('<?= env('APP_URL') ?>/request2')
        </script>
    </body>
</html>
Make a new paste