Paginate bookmarks on tag permalink
This commit is contained in:
parent
a0f116c7a3
commit
1c410ce074
@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Bookmark;
|
||||
use App\Models\Tag;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
@ -38,8 +39,9 @@ class TagController extends Controller
|
||||
{
|
||||
return view(
|
||||
'tag.show', [
|
||||
'tag' => $tag->load('bookmarks'),
|
||||
'tag' => $tag,
|
||||
'tag_count' => $tag->bookmarks()->count(),
|
||||
'bookmarks' => $tag->bookmarks()->latest()->paginate(20),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
@ -2,9 +2,11 @@
|
||||
|
||||
@section('content')
|
||||
<h2>Tag: {{ $tag->name }} ({{ $tag_count }})</h2>
|
||||
{{ $bookmarks->links() }}
|
||||
<div>
|
||||
@foreach ($tag->bookmarks as $bookmark)
|
||||
@foreach ($bookmarks as $bookmark)
|
||||
<x-bookmark :bookmark="$bookmark" />
|
||||
@endforeach
|
||||
</div>
|
||||
{{ $bookmarks->links() }}
|
||||
@endsection
|
||||
|
Loading…
Reference in New Issue
Block a user