Question: When request is json all ok I got my 'xxx' header, but when it's direct request to page - my header does't exists in response.

I tried any variation of `response()->header`, `response('content',200,['xxx'=>'xxx'])` and no success

My code in controller:

```
return $request->wantsJson()
            ? response([
                'html'          => view('components.tarif-list', compact('tarifs'))->render(),
                'pagination'    => $tarifs->appends(request()->query())->links()->toHtml(),
                'head'          => $seo_block,
                'stats'         => $stats
            ])->header('xxx','xxx')
            : response(view('home',compact('tarifs','seo_block'))->render())->header('xxx','xxx');

```

home.blade.php

```
@extends('layouts.main')

@section('content')
    <x-filters/>
    <div id="head" class="alert alert-success" role="alert">
        @if(!empty($seo_block))
        {!! $seo_block !!}
            @elseif($tarifs->isEmpty())
            empty
            @else
            hello
        @endif
    </div>
    {{$tarifs->appends(request()->query())->links()}}
    <table id="tarif-list" class="table table-hover table-striped">
        <x-tarif-list :tarifs="$tarifs"/>
    </table>
    {{$tarifs->appends(request()->query())->links()}}
@endsection

```

Answer: 
My problem was that my children page is `NavigationPage` and I should use `this.Parent.Parent` to cast. So this is how it should be done when u use `NavigaionPage` as `Children` of `TabbedPage`

```
protected override bool OnBackButtonPressed()
{
    var tabbedPage = this.Parent.Parent as TabbedPage;
    tabbedPage.CurrentPage = tabbedPage.Children[0];
    return true;
}

```
Firstly, when you have TabbedPage, `OnBackButtonPressed` is being invoked not in the ContentPage, but instead on the TabbedPage itself. So, the correct place to override the method is in the TabbedPage indeed.

Secondly, if you override the method in the TabbedPage itself, it will do the work, like this:

```cs
protected override bool OnBackButtonPressed()
{
    var firstPage = Children[0];
    if (CurrentPage == firstPage)
    {
        return base.OnBackButtonPressed();
    }

    CurrentPage = firstPage;
    return true;
}

```

NB: Be careful what your `Children` collection is. If you have wrapped your pages in a `NavigationPage`, the check won't be correct.