Translation::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
namespace LaTevaWeb\Translatable\Models;
4
5
use Illuminate\Database\Eloquent\Model;
6
7
class Translation extends Model
8
{
9
    protected $casts = [
10
        'content' => 'array',
11
    ];
12
    protected $fillable = ['content', 'field', 'locale'];
13
    protected $guarded = ['id'];
14
    public $timestamps = false;
15
16
    /**
17
     * Override default constructor to set table using config file.
18
     * @param array $attributes [fields]
19
     */
20 9
    public function __construct(array $attributes = [])
21
    {
22 9
        parent::__construct($attributes);
23 9
        $this->setTable(config('latevaweb-translatable.table_names.translations'));
24 9
    }
25
}
26