Completed
Push — master ( 58043b...413e7c )
by Sergi Tur
06:39
created

UserMigration   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 32
rs 10
c 1
b 0
f 0
wmc 2
lcom 0
cbo 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A user() 0 4 1
A batch() 0 4 1
1
<?php
2
3
namespace Acacha\Users\Models;
4
5
use App\User;
6
use Illuminate\Database\Eloquent\Model;
7
8
/**
9
 * Class UserMigration.
10
 *
11
 * @package Acacha\Users\Models
12
 */
13
class UserMigration extends Model
14
{
15
    /**
16
     * The attributes that are mass assignable.
17
     *
18
     * @var array
19
     */
20
    protected $fillable = ['source_user_id','source_user','user_id'];
21
22
    /**
23
     * Get the user record associated with the invitation.
24
     */
25
    public function user()
26
    {
27
        return $this->belongsTo(User::class);
28
    }
29
30
    /**
31
     * Get the progress batch that this user migration belongs.
32
     */
33
    public function batch()
34
    {
35
        return $this->belongsTo(UserMigrationBatch::class);
36
    }
37
38
    /**
39
     * Relation to eager loading by default.
40
     *
41
     * @var array
42
     */
43
    public $with = ['user'];
44
}
45
46