Error "Trying to get property 'headers' of non-object"

can anyone tell what that is? I try to make middleware, and in addition to request request from input fields, but I get this error, I tried to find in Google nothing really could not find, images with error and middlewarre code I encloseenter image description here

enter image description here

Upvotes: 0

Views: 1677

Answers (1)

Yellowcan
Yellowcan

Reputation: 21

As I can see, here I want to suggest that you should return a method(or route) in your first return sentence. Not just return a string like return "office". For example, if I have a function named:

public function activity() {
    return 'It works.'
}

I will return return redirect('activity'); to replace your string sentences. Beacause I think your should return an object as it shows, so we at least return an object.

Upvotes: 2

Related Questions