I'm using response method withHeaders()
:
return response(view('pages.top.index', compact('data')))->withHeaders(['one-param' => 'data', 'second-param' => 'data2' ...);
And I have multiple same params that I put in withHeaders()
method almost in every Controller's action. Is there a way I can add my own method and chain it like:
return response(view('pages.top.index', compact('data')))->customMethod('data', 'data2', ....);