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()
|
public function index()
|
||||||
{
|
{
|
||||||
$bookmarks = Bookmark::paginate(10);
|
$bookmarks = Bookmark::with('tags')->latest()->paginate(10);
|
||||||
|
|
||||||
return view('bookmarks.index', compact('bookmarks'));
|
return view('bookmarks.index', compact('bookmarks'));
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,19 @@ Bookmarks «
|
||||||
{{ $bookmark->url }}
|
{{ $bookmark->url }}
|
||||||
@endempty
|
@endempty
|
||||||
</a> <a href="/bookmarks/{{ $bookmark->id }}">🔗</a>
|
</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>
|
</div>
|
||||||
@endforeach
|
@endforeach
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{{ $bookmarks->links() }}
|
||||||
@stop
|
@stop
|
||||||
|
|
|
@ -15,5 +15,15 @@ Bookmark «
|
||||||
{{ $bookmark->url }}
|
{{ $bookmark->url }}
|
||||||
@endempty
|
@endempty
|
||||||
</a>
|
</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>
|
</div>
|
||||||
@stop
|
@stop
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue