Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 2 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
| ServiceStat | |
0.00% |
0 / 2 |
|
0.00% |
0 / 2 |
6 | |
0.00% |
0 / 1 |
| brand | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| service | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace App\Models; |
| 4 | |
| 5 | use Illuminate\Database\Eloquent\Factories\HasFactory; |
| 6 | use Illuminate\Database\Eloquent\Model; |
| 7 | |
| 8 | class 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 | } |