Total Complexity | 5 |
Total Lines | 56 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
17 | class Subscription extends Model |
||
18 | { |
||
19 | use Filterable; |
||
20 | |||
21 | /** |
||
22 | * @var array |
||
23 | */ |
||
24 | protected $fillable = [ |
||
25 | 'email', |
||
26 | 'name', |
||
27 | 'country', |
||
28 | 'language', |
||
29 | 'mailing_list_id', |
||
30 | 'user_id', |
||
31 | ]; |
||
32 | |||
33 | /** |
||
34 | * @param $query |
||
35 | * @param $type |
||
36 | * @return mixed |
||
37 | */ |
||
38 | public function scopeMailingList($query, $type) |
||
39 | { |
||
40 | return $query->where('mailing_list_id', $type); |
||
41 | } |
||
42 | |||
43 | /** |
||
44 | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo |
||
45 | */ |
||
46 | public function mailingList() |
||
47 | { |
||
48 | return $this->belongsTo(MailingList::class); |
||
49 | } |
||
50 | |||
51 | /** |
||
52 | * @return \Illuminate\Database\Eloquent\Relations\HasOne |
||
53 | */ |
||
54 | public function user() |
||
57 | } |
||
58 | |||
59 | /** |
||
60 | * @return mixed |
||
61 | */ |
||
62 | public function getCampaigns() |
||
65 | } |
||
66 | |||
67 | public static function boot() |
||
76 |