request() empty in Laravel

887 Views Asked by At

I have a simple Laravel application, in which a third party is redirecting to a route from an external source.

This external site hits a very simple logout controller at /saml/logout


<?php

namespace App\Http\Controllers\Saml;

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Log;

class LogoutController extends Controller
{
    /**
     * Entry point for SAML logout.
     * TODO: check if you need auth to go here.
     *
     * @param \Illuminate\Http\Request $request
     *
     * @return void
     */
    public function logout(Request $request)
    {
        Log::info('Response:', (array) request());
        Log::info('Response:', (array) $_REQUEST);
        Log::info('Response:', (array) $_GET);
        Log::info('Response:', (array) $_POST);
        Log::info('Response:', (array) $request->method());
    }
}


Here is the trace I can see:

enter image description here

So, according to this tracer its able to hit the URL and get a HTTP status of 200.

enter image description here

However, in my logs I get the following.

enter image description here


My question is, why am I getting nothing in my logs in regards to the request?

The only thing I can see that's slightly odd is that something called Sec-Fetch-Dest is set to iframe.

An update given answers.

Using $request->all() gives me nothing.

enter image description here

A further update

enter image description here

1

There are 1 best solutions below

0
VIKAS KATARIYA On

Try $request->all()

public function logout(Request $request)
{
    Log::info('Response:', $request->all());
}