File: /home/xedaptot/hi.naniguide.com/app/Models/UsageLog.php
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class UsageLog extends Model
{
use HasFactory;
protected $fillable = [
'customer_id',
'metric',
'amount',
'period_start',
'period_end',
'context',
];
protected function casts(): array
{
return [
'period_start' => 'date',
'period_end' => 'date',
'context' => 'array',
'amount' => 'integer',
];
}
public function customer(): BelongsTo
{
return $this->belongsTo(Customer::class);
}
}