36 lines
717 B
PHP
36 lines
717 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class PageDailyAggregate extends Model
|
|
{
|
|
protected $fillable = [
|
|
'website_id',
|
|
'date',
|
|
'path',
|
|
'views',
|
|
'unique_views',
|
|
'total_time_on_page',
|
|
'bounces',
|
|
];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'date' => 'date',
|
|
'views' => 'integer',
|
|
'unique_views' => 'integer',
|
|
'total_time_on_page' => 'integer',
|
|
'bounces' => 'integer',
|
|
];
|
|
}
|
|
|
|
public function website(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Website::class);
|
|
}
|
|
}
|