Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 10222730

Přidáno uživatelem Adam Mištera před více než 4 roky(ů)

Issue #7696 2h
[+] Vytvoření detailu artefaktu
[+] Refraktoring, doplnění dokumentace

Zobrazit rozdíly:

app/Http/Controllers/ArtefactController.php
8 8

  
9 9
class ArtefactController extends Controller
10 10
{
11
    /**
12
     * Returns view of all artefacts.
13
     *
14
     * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
15
     */
11 16
    public function default()
12 17
    {
13
        $artefacts = DB::table('artefacts')->get();
18
        $artefacts = Artefact::all();
14 19

  
15 20
        return view('artefact.default', ['artefacts' => $artefacts]);
16 21
    }
22

  
23
    /**
24
     * Returns view of single artefact given by its id.
25
     *
26
     * @param $id int id of the artefact
27
     * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
28
     */
29
    public function view($id)
30
    {
31
        $artefact = Artefact::find($id);
32

  
33
        return view('artefact.view', ['artefact' => $artefact]);
34
    }
17 35
}

Také k dispozici: Unified diff