Show the tags
This commit is contained in:
parent
abe5063c4a
commit
919a6c22ad
3 changed files with 23 additions and 1 deletions
|
@ -8,7 +8,7 @@ class BookmarksController extends Controller
|
|||
{
|
||||
public function index()
|
||||
{
|
||||
$bookmarks = Bookmark::paginate(10);
|
||||
$bookmarks = Bookmark::with('tags')->latest()->paginate(10);
|
||||
|
||||
return view('bookmarks.index', compact('bookmarks'));
|
||||
}
|
||||
|
|
|
@ -17,7 +17,19 @@ Bookmarks «
|
|||
{{ $bookmark->url }}
|
||||
@endempty
|
||||
</a> <a href="/bookmarks/{{ $bookmark->id }}">🔗</a>
|
||||
@isset($bookmark->content)
|
||||
<p>{{ $bookmark->content }}</p>
|
||||
@endisset
|
||||
@if(count($bookmark->tags()->get()) > 0)
|
||||
<ul>
|
||||
@foreach($bookmark->tags as $tag)
|
||||
<li><a href="/bookmarks/tagged/{{ $tag->tag }}">{{ $tag->tag }}</a></li>
|
||||
@endforeach
|
||||
</ul>
|
||||
@endif
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
|
||||
{{ $bookmarks->links() }}
|
||||
@stop
|
||||
|
|
|
@ -15,5 +15,15 @@ Bookmark «
|
|||
{{ $bookmark->url }}
|
||||
@endempty
|
||||
</a>
|
||||
@isset($bookmark->content)
|
||||
<p>{{ $bookmark->content }}</p>
|
||||
@endisset
|
||||
@if(count($bookmark->tags()->get()) > 0)
|
||||
<ul>
|
||||
@foreach($bookmark->tags as $tag)
|
||||
<li><a href="/bookmarks/tagged/{{ $tag->tag }}">{{ $tag->tag }}</a></li>
|
||||
@endforeach
|
||||
</ul>
|
||||
@endif
|
||||
</div>
|
||||
@stop
|
||||
|
|
Loading…
Add table
Reference in a new issue