Code Duplication    Length = 47-47 lines in 2 locations

app/Models/General/IPv4.php 1 location

@@ 50-96 (lines=47) @@
47
 * @method static \Illuminate\Database\Query\Builder|\App\Models\General\IPv4 whereContextName($value)
48
 * @mixin \Eloquent
49
 */
50
class IPv4 extends Model
51
{
52
53
    protected $hidden = ['ip'];
54
55
    /**
56
     * Indicates if the model should be timestamped.
57
     *
58
     * @var bool
59
     */
60
    public $timestamps = false;
61
    /**
62
     * The table associated with the model.
63
     *
64
     * @var string
65
     */
66
    protected $table = 'ipv4_addresses';
67
    /**
68
     * The primary key column name.
69
     *
70
     * @var string
71
     */
72
    protected $primaryKey = 'ipv4_address_id';
73
74
75
    // ---- Accessors/Mutators ----
76
77
78
    // ---- Define Reletionships ----
79
80
    /**
81
     * Returns the port this entry belongs to.
82
     */
83
    public function port()
84
    {
85
        return $this->belongsTo('App\Models\Port', 'port_id', 'port_id');
86
    }
87
88
    /**
89
     * Returns the device this entry belongs to.
90
     */
91
    public function device()
92
    {
93
        return $this->belongsTo('App\Models\Device', 'device_id', 'device_id');
94
    }
95
96
}
97

app/Models/General/IPv6.php 1 location

@@ 54-100 (lines=47) @@
51
 * @method static \Illuminate\Database\Query\Builder|\App\Models\General\IPv6 whereContextName($value)
52
 * @mixin \Eloquent
53
 */
54
class IPv6 extends Model
55
{
56
57
    protected $hidden = ['ip'];
58
59
    /**
60
     * Indicates if the model should be timestamped.
61
     *
62
     * @var bool
63
     */
64
    public $timestamps = false;
65
    /**
66
     * The table associated with the model.
67
     *
68
     * @var string
69
     */
70
    protected $table = 'ipv6_addresses';
71
    /**
72
     * The primary key column name.
73
     *
74
     * @var string
75
     */
76
    protected $primaryKey = 'ipv6_address_id';
77
78
79
    // ---- Accessors/Mutators ----
80
81
82
    // ---- Define Reletionships ----
83
84
    /**
85
     * Returns the port this entry belongs to.
86
     */
87
    public function port()
88
    {
89
        return $this->belongsTo('App\Models\Port', 'port_id', 'port_id');
90
    }
91
92
    /**
93
     * Returns the device this entry belongs to.
94
     */
95
    public function device()
96
    {
97
        return $this->belongsTo('App\Models\Device', 'device_id', 'device_id');
98
    }
99
100
}
101