Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
50.00% covered (danger)
50.00%
1 / 2
50.00% covered (danger)
50.00%
1 / 2
CRAP
0.00% covered (danger)
0.00%
0 / 1
IntegrationProvider
50.00% covered (danger)
50.00%
1 / 2
50.00% covered (danger)
50.00%
1 / 2
2.50
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
 integrations
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\HasMany;
9
10class IntegrationProvider extends Model
11{
12    use HasFactory;
13
14    protected $fillable = ['name', 'slug', 'status'];
15
16    protected function casts(): array
17    {
18        return ['status' => Status::class];
19    }
20
21    public function integrations(): HasMany
22    {
23        return $this->hasMany(StoreIntegration::class, 'provider_id');
24    }
25}