Passed
Push — master ( 6bbf15...aead9d )
by Jonathan
19:29
created

UserSettings::user()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Uccello\Core\Models;
4
5
use Uccello\Core\Database\Eloquent\Model;
6
7
class UserSettings extends Model
8
{
9
    /**
10
     * The table associated with the model.
11
     *
12
     * @var string
13
     */
14
    protected $table = 'user_settings';
15
16
    /**
17
     * The primary key for the model.
18
     *
19
     * @var string
20
     */
21
    protected $primaryKey = 'user_id';
22
23
    /**
24
     * The attributes that are mass assignable.
25
     *
26
     * @var array
27
     */
28
    protected $fillable = [
29
        'user_id',
30
        'data',
31
    ];
32
33
    /**
34
     * The attributes that should be casted to native types.
35
     *
36
     * @var array
37
     */
38
    protected $casts = [
39
        'data' => 'object',
40
    ];
41
42
    protected function initTablePrefix()
43
    {
44
        $this->tablePrefix = env('UCCELLO_TABLE_PREFIX', 'uccello_');
0 ignored issues
show
Bug introduced by
The function env was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

44
        $this->tablePrefix = /** @scrutinizer ignore-call */ env('UCCELLO_TABLE_PREFIX', 'uccello_');
Loading history...
45
    }
46
47
    public function user()
48
    {
49
        return $this->belongsTo(User::class);
50
    }
51
}
52