2017-10-10 15:58:07 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
|
|
|
|
use App\Bookmark;
|
|
|
|
|
|
|
|
class BookmarksController extends Controller
|
|
|
|
{
|
|
|
|
public function index()
|
|
|
|
{
|
2017-10-11 18:04:05 +01:00
|
|
|
$bookmarks = Bookmark::latest()->with('tags')->withCount('tags')->paginate(10);
|
2017-10-10 15:58:07 +01:00
|
|
|
|
|
|
|
return view('bookmarks.index', compact('bookmarks'));
|
|
|
|
}
|
2017-10-10 16:17:29 +01:00
|
|
|
|
|
|
|
public function show(Bookmark $bookmark)
|
|
|
|
{
|
2017-10-11 18:04:05 +01:00
|
|
|
$bookmark->loadMissing('tags');
|
|
|
|
|
2017-10-10 16:17:29 +01:00
|
|
|
return view('bookmarks.show', compact('bookmark'));
|
|
|
|
}
|
2017-10-10 15:58:07 +01:00
|
|
|
}
|