aswi2020merlot-gitlab/app/Http/Controllers/FavoriteMetadataController.php @ 31d75014
1 | 09795926 | Adam Mištera | <?php
|
---|---|---|---|
2 | |||
3 | namespace App\Http\Controllers; |
||
4 | |||
5 | use App\Metadata; |
||
6 | use App\User; |
||
7 | use Illuminate\Http\Request; |
||
8 | use Illuminate\Support\Facades\Auth; |
||
9 | |||
10 | class FavoriteMetadataController extends Controller |
||
11 | {
|
||
12 | public function __construct() |
||
13 | {
|
||
14 | $this->middleware('auth'); |
||
15 | }
|
||
16 | |||
17 | public function index() |
||
18 | {
|
||
19 | $metadata = User::find(Auth::id())->likesMetadata()->get(); |
||
20 | |||
21 | return view('favmetadata.index', ['metadata' => $metadata]); |
||
22 | }
|
||
23 | |||
24 | }
|