I have a problem using the pagination from Laravel Livewire. I use the bootstrap view from livewire and it’s working fine.
In other projects i used something like this (without Livewire) to set the robots nofollow/follow attribute:
@if($listings->currentPage() == 1)
<meta name="robots" content="index, follow">
@else
<meta name="robots" content="noindex, follow">
@endif
But in livewire i don’t have the opportunity to use currentPage()
I tried to use somehting like this in my livewire controller:
$robots = $this->currentPage() == 1 ? 'index, follow' : 'noindex, follow';
And then use the
@section('robots')
<meta name="robots" content="{{ $robots }}">
@endsection
But sill getting the error: Method AppLivewireProviderListingFilter::currentPage does not exist.
Is there any simple solution to do that? I can’t find anything in the docs.