Completed
Branch 2.0 (238d23)
by Zhengchao
02:57 queued 02:05
created

Referral   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 19
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A referrer() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of questocat/laravel-referral package.
5
 *
6
 * (c) questocat <[email protected]>
7
 *
8
 * This source file is subject to the MIT license that is bundled
9
 * with this source code in the file LICENSE.
10
 */
11
12
namespace Questocat\Referral;
13
14
use Illuminate\Database\Eloquent\Model;
15
16
class Referral extends Model
17
{
18
    /**
19
     * The attributes that are mass assignable.
20
     *
21
     * @var array
22
     */
23
    protected $fillable = [
24
        'referrer_id', 'referral_id',
25
    ];
26
27
    /**
28
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
29
     */
30
    public function referrer()
31
    {
32
        return $this->belongsTo(config('referral.user_model', 'App\User'), 'referral_id');
33
    }
34
}
35