-
-
Notifications
You must be signed in to change notification settings - Fork 186
Expand file tree
/
Copy pathUser.php
More file actions
41 lines (33 loc) · 849 Bytes
/
User.php
File metadata and controls
41 lines (33 loc) · 849 Bytes
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
<?php
namespace App\Models;
use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;
class User extends Authenticatable
{
use Notifiable;
protected $fillable = [
'name',
'email',
'password',
'verification_token',
'last_verification_mail_sent_at',
'stripe_customer_id',
'plan'
];
protected $hidden = [
'password', 'remember_token',
];
protected $attributes = [
'plan' => 'standard'
];
// Accessors
public function getAvatarPathAttribute($avatar)
{
return $avatar ? '/storage/avatars/' . $avatar : 'https://via.placeholder.com/250';
}
// Relations
public function spaces()
{
return $this->belongsToMany(Space::class, 'user_space')->withPivot('role');
}
}