forked from livewire/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUser.php
51 lines (42 loc) · 1.06 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
50
51
<?php
namespace App;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
class User extends Authenticatable
{
use Notifiable;
protected $guarded = [];
public function sponsor()
{
return $this->hasOne(Sponsor::class, 'username', 'github_username');
}
public function getIsSponsorAttribute()
{
if (in_array($this->github_username, [
'calebporzio',
'calebporzio-test',
// Gift
'foremtehan',
// DevSquad
'r2luna',
'danieldevsquad',
// Kevin
'iAmKevinMcKee',
// Neerav Pandya
'neeravp',
'RicardoRamirezR',
'ngcammayo',
'mohsenbostan',
'mitchjam',
'amirzpr',
])) return true;
if ($this->sponsor) {
return $this->sponsor->getsScreencasts();
}
return false;
}
public function uiActions()
{
return $this->hasMany(UiAction::class);
}
}