Passed
Push — master ( fb19b8...ca6211 )
by Andrey
14:27
created

BaseModel::scopeSearchBy()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 2
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Helldar\Roles\Models;
4
5
use Helldar\Roles\Facades\Config;
6
use Helldar\Roles\Traits\Searchable;
7
use Helldar\Roles\Traits\SetAttribute;
8
use Illuminate\Database\Eloquent\Model;
9
10
/**
11
 * @property int $id
12
 * @property string $slug
13
 * @property string $title
14
 *
15
 * @method static Model|self create(array $values)
16
 */
17
abstract class BaseModel extends Model
18
{
19
    use SetAttribute;
20
    use Searchable;
21
22
    public $timestamps = false;
23
24
    protected $fillable = ['slug', 'title'];
25
26
    public function __construct(array $attributes = [])
27
    {
28
        $this->setConnection(
29 72
            Config::connection()
30
        );
31 72
32 72
        parent::__construct($attributes);
33
    }
34
}
35