Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
2 / 2
CRAP
100.00% covered (success)
100.00%
1 / 1
ServiceStat
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
2 / 2
2
100.00% covered (success)
100.00%
1 / 1
 brand
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 service
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3namespace App\Models;
4
5use Illuminate\Database\Eloquent\Factories\HasFactory;
6use Illuminate\Database\Eloquent\Model;
7
8class ServiceStat extends Model
9{
10    use HasFactory;
11
12    /**
13     * The attributes that are mass assignable.
14     *
15     * @var string[]
16     */
17    protected $fillable = ['date'];
18
19    /**
20     * The model's attributes.
21     *
22     * @var array
23     */
24    protected $attributes = [
25        'nb_calls' => 0
26    ];
27
28    // * RELATIONS
29
30    /**
31     * Brand BelongsTo relation
32     *
33     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
34     */
35    public function brand()
36    {
37        return $this->belongsTo(Brand::class);
38    }
39
40    /**
41     * Service BelongsTo relation
42     *
43     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
44     */
45    public function service()
46    {
47        return $this->belongsTo(Service::class);
48    }
49}