ldc-crm/app/Models/ServiceStat.php
Alexis Gousseau 303834bbca
Crm V4
- Make all tests pass Client (V4),CRMV2,CRMV4
- Simplify client submodule path
- Move App_url to .env.testing
2023-10-06 16:37:29 +02:00

72 lines
1.8 KiB
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
/**
* @property integer $id Id.
* @property integer $brand_id Foreign key Brand.
* @property integer $service_id Foreign key Service.
* @property \Illuminate\Support\Carbon $date Date.
* @property integer $nb_calls Nombre d'appels.
* @property-read \Illuminate\Support\Carbon $created_at Created date.
* @property-read \Illuminate\Support\Carbon $updated_at Updated date.
*
* @property-read \App\Models\Brand $brand Brand BelongsTo relation.
* @property-read \App\Models\Service $service Service BelongsTo relation.
*/
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,
];
/**
* Map attribute names to enum classes.
*
* @var array
*/
protected $casts = [
'date' => 'date',
];
// * RELATIONS
/**
* Brand BelongsTo relation.
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function brand(): \Illuminate\Database\Eloquent\Relations\BelongsTo
{
return $this->belongsTo(Brand::class);
}
/**
* Service BelongsTo relation.
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function service(): \Illuminate\Database\Eloquent\Relations\BelongsTo
{
return $this->belongsTo(Service::class);
}
}