-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUser.php
executable file
·49 lines (43 loc) · 1 KB
/
User.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
namespace App;
use Laravel\Scout\Searchable;
use Illuminate\Notifications\Notifiable;
use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Foundation\Auth\User as Authenticatable;
use App\Events\User\UserCreated;
class User extends Authenticatable
{
use Notifiable;
use Searchable;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'name', 'email', 'password',
];
protected $dispatchesEvents = [
'created' => UserCreated::class,
];
/**
* The attributes that should be hidden for arrays.
*
* @var array
*/
protected $hidden = [
'password', 'remember_token',
];
public function wallet()
{
return $this->hasOne('App\PW');
}
public function touser()
{
return $this->hasMany('App\Transaction', 'source', 'id');
}
public function fromuser()
{
return $this->hasMany('App\Transaction', 'destination', 'id');
}
}