@if(session('success'))
{{ session('success') }}
@endif
@if(session('error'))
{{ session('error') }}
@endif
|
{{ __('Title') }}
|
{{ __('Author') }}
|
{{ __('Category') }}
|
{{ __('Status') }}
|
{{ __('Actions') }}
|
@foreach($articles as $article)
|
{{ $article->title }}
|
{{ $article->user->name }}
|
{{ $article->category->title }}
|
{{ __(ucwords(str_replace('_', ' ', $article->status))) }}
|
{{ __('Edit') }}
|
@endforeach
@if ($articles->hasPages())
Showing
{{ $articles->firstItem() }}
to
{{ $articles->lastItem() }}
of
{{ $articles->total() }}
results
{{-- Previous --}}
@if ($articles->onFirstPage())
Previous
@else
Previous
@endif
@php
$current = $articles->currentPage();
$last = $articles->lastPage();
if ($last <= 7) {
$start = 1;
$end = $last;
} else {
if ($current <= 4) {
$start = 1;
$end = 5;
} elseif ($current >= $last - 3) {
$start = $last - 4;
$end = $last;
} else {
$start = $current - 2;
$end = $current + 2;
}
}
@endphp
{{-- First Page --}}
@if($start > 1)
1
@if($start > 2)
...
@endif
@endif
{{-- Middle Pages --}}
@for($page = $start; $page <= $end; $page++)
@if($page == $current)
{{ $page }}
@else
{{ $page }}
@endif
@endfor
{{-- Last Page --}}
@if($end < $last)
@if($end < $last - 1)
...
@endif
{{ $last }}
@endif
{{-- Next --}}
@if ($articles->hasMorePages())
Next
@else
Next
@endif
@endif