Test Failed
Pull Request — master (#2)
by
unknown
04:16
created

Translation::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 0
cts 5
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 2
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
    public function __construct(array $attributes = [])
21
    {
22
        parent::__construct($attributes);
23
        $this->setTable(config('translatable.table_names.translations'));
24
    }
25
}
26