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;
}

```
You could set the current TabbedPage in **App.xaml.cs** when set the **MainPage** of App .

### in App.xaml.cs

MainPage here is the TabbedPage in your project.

```
public partial class App : Application
{
    public MainPage CurrentPage { get; }
    public App()
    {
        InitializeComponent();

        MainPage tabbedPage = new MainPage();
        CurrentPage = tabbedPage;

        DependencyService.Register<MockDataStore>();
        MainPage = tabbedPage;
    }
    //...
}

```

And now you can access it in child page .

```
protected override bool OnBackButtonPressed()
{

    App currentApp = Application.Current as App;
    var tabbedpage = currentApp.CurrentPage;

    tabbedpage.CurrentPage = tabbedpage.Children[0];

    return true;

}

```

The above code works fine in my project. If it still doesn't work on your side, you could share a sample so that I can test it .