Answers for "Attempt to read property "headers" on string"

PHP
0

Attempt to read property "headers" on string

Well in my case, the error happened in my middleware called 
AuthenticationMiddleware when i tried the example below:

I was giving a return of a response without using the Response method. 

Error : return "Welcome, " . $request->session()->get('user')->name

Solution: return Response("Welcome, " . $request->session()->get('user')->name);
Posted by: Guest on March-13-2022

Code answers related to "Attempt to read property "headers" on string"

Browse Popular Code Answers by Language