Completed
Push — dev ( 4f11ce...5d65d1 )
by Alies
06:00 queued 01:47
created

Campaign::translations()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
nc 1
nop 0
dl 0
loc 3
c 0
b 0
f 0
cc 1
rs 10
1
<?php
2
3
namespace Diglabby\Doika\Models;
4
5
use Illuminate\Database\Eloquent\Model;
6
use Illuminate\Database\Eloquent\Relations\HasMany;
7
use Illuminate\Database\Eloquent\SoftDeletes;
8
use Illuminate\Support\Carbon;
9
10
/**
11
 * @property int $id
12
 * @property string $name
13
 * @property string $description
14
 * @property string $picture_url
15
 * @property int $target_amount
16
 * @property string $currency
17
 * @property Carbon $started_at
18
 * @property Carbon $finished_at
19
 * @property bool $active_status
20
 * @property Carbon $created_at
21
 * @property Carbon $updated_at
22
 * @property Carbon|null $deleted_at
23
 *
24
 * Relationships
25
 * @property Transaction[] $translations
26
 */
27
final class Campaign extends Model
28
{
29
    use SoftDeletes;
30
31
    /** @var array The attributes that should be mutated to dates */
32
    protected $dates = [
33
        'started_at',
34
        'finished_at',
35
        'created_at',
36
        'updated_at',
37
        'deleted_at',
38
    ];
39
40
    /** @var array The attributes that should be cast to native types */
41
    protected $casts = [
42
        'active_status' => 'bool',
43
    ];
44
45
    /** @var array Default attribute values */
46
    protected $attributes = [
47
        'active_status' => false,
48
    ];
49
50
    public function translations(): HasMany
51
    {
52
        return $this->hasMany(CampaignTranslation::class);
53
    }
54
}
55