ldc-flucollector/app/Models/ServiceStat.php

41 lines
759 B
PHP
Raw Normal View History

2023-09-20 12:12:56 +02:00
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
2023-09-28 12:05:50 +02:00
use Illuminate\Database\Eloquent\Relations\BelongsTo;
2023-09-20 12:12:56 +02:00
class ServiceStat extends Model
{
use HasFactory;
/**
* The attributes that are mass assignable.
*
* @var string[]
*/
protected $fillable = ['date'];
/**
* The model's attributes.
*
* @var array
*/
protected $attributes = [
'nb_calls' => 0
];
// * RELATIONS
/**
2023-09-28 12:05:50 +02:00
* Get the Service that owns the ServiceStat
2023-09-20 12:12:56 +02:00
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
2023-09-28 12:05:50 +02:00
public function service(): BelongsTo
2023-09-20 12:12:56 +02:00
{
return $this->belongsTo(Service::class);
}
}