aswi2020merlot-gitlab/app/User.php @ b96eedd9
1 |
<?php
|
---|---|
2 |
|
3 |
namespace App; |
4 |
|
5 |
use Illuminate\Contracts\Auth\MustVerifyEmail; |
6 |
use Illuminate\Foundation\Auth\User as Authenticatable; |
7 |
use Illuminate\Notifications\Notifiable; |
8 |
|
9 |
class User extends Authenticatable |
10 |
{
|
11 |
use Notifiable; |
12 |
|
13 |
// Table Name
|
14 |
protected $table = 'users'; |
15 |
// Primary Key
|
16 |
public $primaryKey = 'id';//unnecessery? |
17 |
|
18 |
/**
|
19 |
* The attributes that are mass assignable.
|
20 |
*
|
21 |
* @var array
|
22 |
*/
|
23 |
protected $fillable = [ |
24 |
'name', 'email', 'password' |
25 |
];
|
26 |
|
27 |
/**
|
28 |
* The attributes that should be hidden for arrays.
|
29 |
*
|
30 |
* @var array
|
31 |
*/
|
32 |
protected $hidden = [ |
33 |
'remember_token', 'password' |
34 |
];
|
35 |
|
36 |
/**
|
37 |
* The attributes that should be cast to native types.
|
38 |
*
|
39 |
* @var array
|
40 |
*/
|
41 |
protected $casts = [ |
42 |
'email_verified_at' => 'datetime', |
43 |
];
|
44 |
|
45 |
/**
|
46 |
* Get the artefacts for the user.
|
47 |
*/
|
48 |
public function likesArtefacts() |
49 |
{
|
50 |
return $this->belongsToMany('App\Artefact'); |
51 |
}
|
52 |
|
53 |
/**
|
54 |
* Get the metadata for the user.
|
55 |
*/
|
56 |
public function likesMetadata() |
57 |
{
|
58 |
return $this->belongsToMany('App\Metadata'); |
59 |
}
|
60 |
}
|
- « Předchozí
- 1
- 2
- 3
- 4
- Další »