Projekt

Obecné

Profil

Stáhnout (1019 Bajtů) Statistiky
| Větev: | Tag: | Revize:
1
<?php
2

    
3
namespace App\Http\Controllers;
4

    
5
use App\ArtefactUser;
6
use Illuminate\Http\Request;
7
use App\Metadata;
8
use App\Artefact;
9

    
10
class DetailsController extends Controller
11
{
12
    /**
13
     * Display a listing of the resource.
14
     *
15
     * @return \Illuminate\Http\Response
16
     */
17
    public function index()
18
    {
19
        $data = array(
20
            'title' => 'Welcome to the MERLOT page',
21
        );
22
        //return view('index', compact('title'));
23
        return view('index') -> with($data);
24
    }
25

    
26
    /**
27
     * Display the specified resource.
28
     *
29
     * @param  int  $id
30
     * @return \Illuminate\Http\Response
31
     */
32
    public function show($id)
33
    {
34
        $data = array(
35
            'title' => 'Title of the BOOK',
36
            'id' => $id,
37
            'arrArtefact' => Artefact::find($id),
38
            'likes' => ArtefactUser::where('artefact_id', $id)->get(),
39
            'metadata' => Metadata::where('artefact_id', $id)->get()
40
        );
41
        return view('detail.index') -> with($data);
42
    }
43

    
44
}
(2-2/3)