36 lines
728 B
PHP
36 lines
728 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class DailyAggregate extends Model
|
|
{
|
|
protected $fillable = [
|
|
'website_id',
|
|
'date',
|
|
'visitors',
|
|
'sessions',
|
|
'page_views',
|
|
'bounce_count',
|
|
'total_duration',
|
|
];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'visitors' => 'integer',
|
|
'sessions' => 'integer',
|
|
'page_views' => 'integer',
|
|
'bounce_count' => 'integer',
|
|
'total_duration' => 'integer',
|
|
];
|
|
}
|
|
|
|
public function website(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Website::class);
|
|
}
|
|
}
|