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

PanelAdmin   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 7
dl 0
loc 24
rs 10
c 2
b 0
f 0
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A user() 0 3 1
A __construct() 0 9 2
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