Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
25.00% covered (danger)
25.00%
1 / 4
25.00% covered (danger)
25.00%
1 / 4
CRAP
0.00% covered (danger)
0.00%
0 / 1
Store
25.00% covered (danger)
25.00%
1 / 4
25.00% covered (danger)
25.00%
1 / 4
10.75
0.00% covered (danger)
0.00%
0 / 1
 casts
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 tenant
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 integrations
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 influencers
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2
3namespace App\Models;
4
5use App\Enums\Status;
6use Illuminate\Database\Eloquent\Factories\HasFactory;
7use Illuminate\Database\Eloquent\Model;
8use Illuminate\Database\Eloquent\Relations\BelongsTo;
9use Illuminate\Database\Eloquent\Relations\HasMany;
10
11class Store extends Model
12{
13    use HasFactory;
14
15    protected $fillable = ['tenant_id', 'name', 'slug', 'status'];
16
17    protected function casts(): array
18    {
19        return ['status' => Status::class];
20    }
21
22    public function tenant(): BelongsTo
23    {
24        return $this->belongsTo(Tenant::class);
25    }
26
27    public function integrations(): HasMany
28    {
29        return $this->hasMany(StoreIntegration::class);
30    }
31
32    public function influencers(): HasMany
33    {
34        return $this->hasMany(Influencer::class);
35    }
36}