Total Complexity | 7 |
Total Lines | 60 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
8 | class Candidate extends Model |
||
9 | { |
||
10 | use SoftDeletes; |
||
|
|||
11 | |||
12 | protected $connection = 'tenant'; |
||
13 | |||
14 | /** |
||
15 | * The attributes that should be mutated to dates. |
||
16 | * |
||
17 | * @var array |
||
18 | */ |
||
19 | protected $dates = ['deleted_at']; |
||
20 | |||
21 | protected $fillable = [ |
||
22 | 'name', |
||
23 | 'email', |
||
24 | 'phone_number', |
||
25 | 'recruitment_id', |
||
26 | ]; |
||
27 | |||
28 | public function recruitment() |
||
29 | { |
||
30 | return $this->belongsTo(Recruitment::class); |
||
31 | } |
||
32 | |||
33 | public function source() |
||
34 | { |
||
35 | return $this->belongsTo(Source::class); |
||
36 | } |
||
37 | |||
38 | public function stage() |
||
39 | { |
||
40 | return $this->belongsTo(Stage::class); |
||
41 | } |
||
42 | |||
43 | public function notes() |
||
44 | { |
||
45 | return $this->hasMany(Note::class); |
||
46 | } |
||
47 | |||
48 | public function messages() |
||
51 | } |
||
52 | |||
53 | public function activities() |
||
56 | } |
||
57 | |||
58 | /** |
||
59 | * Scope a query to only include unseen candidates. |
||
60 | * |
||
61 | * @param \Illuminate\Database\Eloquent\Builder $query |
||
62 | * |
||
63 | * @return \Illuminate\Database\Eloquent\Builder |
||
64 | */ |
||
65 | public function scopeUnseen($query) |
||
70 |