Code Duplication    Length = 7-8 lines in 4 locations

app/Travel.php 1 location

@@ 43-50 (lines=8) @@
40
     *
41
     * @return $this
42
     */
43
    public function setAttribute($key, $value)
44
    {
45
        if (is_scalar($value) && $value === '') {
46
            $value = null;
47
        }
48
49
        return parent::setAttribute($key, $value);
50
    }
51
}
52

app/TrainingUser.php 1 location

@@ 64-71 (lines=8) @@
61
     *
62
     * @return $this
63
     */
64
    public function setAttribute($key, $value)
65
    {
66
        if (is_scalar($value) && $value === '') {
67
            $value = null;
68
        }
69
70
        return parent::setAttribute($key, $value);
71
    }
72
73
    /**
74
     * @param $query

app/News.php 1 location

@@ 50-56 (lines=7) @@
47
     *
48
     * @return $this
49
     */
50
    public function setAttribute($key, $value)
51
    {
52
        if (is_scalar($value) && $value === '') {
53
            $value = null;
54
        }
55
56
        return parent::setAttribute($key, $value);
57
    }
58
59
    public function getPublishDateAttribute()

app/User.php 1 location

@@ 173-180 (lines=8) @@
170
     *
171
     * @return $this
172
     */
173
    public function setAttribute($key, $value)
174
    {
175
        if (is_scalar($value) && $value === '') {
176
            $value = null;
177
        }
178
179
        return parent::setAttribute($key, $value);
180
    }
181
182
    /**
183
     * @param $user