AchievementCriteriaModel::achievement()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Laravel\Achievements;
4
5
use Illuminate\Database\Eloquent\Model;
6
7
/**
8
 * Class AchievementCriteriaModel
9
 *
10
 * @property int $id
11
 * @property int $achievement_id
12
 * @property string $type
13
 * @property string $name
14
 * @property int $max_value
15
 * @property array $requirements
16
 * @property \Carbon\Carbon $created_at
17
 * @property \Carbon\Carbon $updated_at
18
 * @property AchievementModel $achievement
19
 */
20
class AchievementCriteriaModel extends Model
21
{
22
    /**
23
     * @var string
24
     */
25
    protected $table = 'achievement_criterias';
26
27
    /**
28
     * @var array
29
     */
30
    protected $fillable = [
31
        'achievement_id', 'type', 'name',
32
        'max_value', 'requirements',
33
    ];
34
35
    /**
36
     * @var array
37
     */
38
    protected $casts = [
39
        'achievement_id' => 'integer',
40
        'max_value' => 'integer',
41
        'requirements' => 'array',
42
    ];
43
44
    /**
45
     * Achievement.
46
     *
47
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
48
     */
49
    public function achievement()
50
    {
51
        return $this->belongsTo(config('achievements.models.achievement'));
52
    }
53
}
54