Projekt

Obecné

Profil

« Předchozí | Další » 

Revize dc0fb924

Přidáno uživatelem Marek Zábran před více než 4 roky(ů)

Dodělání hlavní categorie dle hovoru s Fišárkem.

Zobrazit rozdíly:

app/Artefact.php
35 35
        return $this->hasMany('App\Metadata');
36 36
    }
37 37

  
38
    /**
39
     * Get the main category for the artefact.
40
     */
41
    public function main_category()
42
    {
43
        return $this->hasOne('App\Category', 'main_category_id');
44
    }
45

  
38 46
    /**
39 47
     * Get the categories for the artefact.
40 48
     */
database/migrations/2020_03_20_000000_CreateArtefactsTable.php
22 22
            $table->integer('year');
23 23
            $table->integer('pages');
24 24
            $table->integer('likes');
25

  
26
            $table->integer('main_category_id')->unsigned();
27
            $table->foreign('main_category_id')->references('id')->on('categories');
25 28
        });
26 29
    }
27 30

  

Také k dispozici: Unified diff