ldc-boutique-cnc-sable/app/Models/Stat.php
2026-10-27 09:58:12 +01:00

39 lines
926 B
PHP

<?php
declare(strict_types=1);
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
/**
* @property int $id
* @property string $product_id
* @property \Illuminate\Support\Carbon $date
* @property float $margin
* @property int $nb_sale
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \App\Models\Product|null $product
*
* @mixin \Eloquent
*/
class Stat extends Model
{
/** @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\App\Models\Product,$this> */
public function product(): BelongsTo
{
return $this->belongsTo(Product::class);
}
#[\Override]
protected function casts(): array
{
return [
'date' => 'datetime',
'margin' => 'float',
'nb_sale' => 'int',
];
}
}