Projekt

Obecné

Profil

« Předchozí | Další » 

Revize e765fd91

Přidáno uživatelem Marek Lovčí před téměř 5 roky(ů)

Relace Metadata|User.
Issue #7847 @0.25h

Zobrazit rozdíly:

app/Metadata.php
7 7
class Metadata extends Model
8 8
{
9 9
    // Table Name
10
    protected $table = 'metadata';//same name could make problems
10
    protected $table = 'metadata';
11 11
    // Primary Key
12
    public $primaryKey = 'id';//unnecessery?
13

  
14
    /**
15
     * The model's default values for attributes.
16
     *
17
     * @var array
18
     */
19
    /*protected $attributes = [
20
        'likes' => 0,
21
    ];*/
12
    public $primaryKey = 'id';
22 13

  
23 14
    /**
24 15
     * Indicates if the model should be timestamped.
......
34 25
        return $this->belongsTo('App\Artefact');
35 26
    }
36 27

  
37

  
28
    /**
29
     * Get the users for the metadata.
30
     */
31
    public function users()
32
    {
33
        return $this->belongsToMany('App\User');
34
    }
38 35
}

Také k dispozici: Unified diff