Passed
Pull Request — master (#76)
by
unknown
20:16
created

PanelAdmin::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
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
4
namespace EasyPanel\Models;
5
6
7
use Illuminate\Database\Eloquent\Model;
8
9
class PanelAdmin extends Model
10
{
11
12
    /**
13
    * Create a new Eloquent model instance.
14
    *
15
    * @param array $attributes
16
    */
17
    public function __construct(array $attributes = [])
18
    {
19
        $connection = config('easy_panel_config.database.connection') ?: config('database.default');
20
21
        $this->setConnection($connection);
22
23
        $this->setTable(config('easy_panel_config.database.panel_admin_table'));
24
25
        parent::__construct($attributes);
26
    }
27
28
    protected $guarded = [];
29
30
    public function user()
31
    {
32
        return $this->belongsTo(config('easy_panel.user_model'));
33
    }
34
}
35