1 | <?php |
||
7 | class User extends Authenticatable |
||
8 | { |
||
9 | /** |
||
10 | * The attributes that are mass assignable. |
||
11 | * |
||
12 | * @var array |
||
13 | */ |
||
14 | protected $fillable = [ |
||
15 | 'name', |
||
16 | 'email', |
||
17 | 'username', |
||
18 | 'avatar', |
||
19 | 'provider_id', |
||
20 | 'provider', |
||
21 | 'password', |
||
22 | 'about', |
||
23 | ]; |
||
24 | |||
25 | /** |
||
26 | * The attributes excluded from the model's JSON form. |
||
27 | * |
||
28 | * @var array |
||
29 | */ |
||
30 | protected $hidden = [ |
||
31 | 'password', |
||
32 | 'remember_token', |
||
33 | ]; |
||
34 | |||
35 | /** |
||
36 | * A user can have many videos |
||
37 | * |
||
38 | * @return Object |
||
39 | */ |
||
40 | public function videos() |
||
41 | { |
||
42 | return $this->hasMany('LearnParty\Video'); |
||
43 | } |
||
44 | |||
45 | /** |
||
46 | * A user can have many comments |
||
47 | * |
||
48 | * @return Object |
||
49 | */ |
||
50 | public function comments() |
||
54 | |||
55 | /** |
||
56 | * A user can have many favorites |
||
57 | * |
||
58 | * @return Object |
||
59 | */ |
||
60 | public function favorites() |
||
64 | } |
||
65 |