Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 43bb92a9

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

Úprava databáze - přidání uživatelů a reference lajků.
Issue #7787 @2h

Zobrazit rozdíly:

app/Artefact.php
16 16
     *
17 17
     * @var array
18 18
     */
19
    protected $attributes = [
19
    /*protected $attributes = [
20 20
        'likes' => 0,
21
    ];
21
    ];*/
22 22

  
23 23
    /**
24 24
     * Indicates if the model should be timestamped.
......
36 36
    }
37 37

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

  
46 46
    /**
47
     * Get the categories for the artefact.
47
     * Get the users for the artefact.
48 48
     */
49
    public function categories()
49
    public function users()
50 50
    {
51
        return $this->belongsToMany('App\Category');
51
        return $this->belongsToMany('App\User');
52 52
    }
53 53

  
54 54

  
55 55

  
56

  
57 56
}

Také k dispozici: Unified diff