phase 8 and 9

This commit is contained in:
Stefanescu Mihai
2026-03-19 18:42:19 +02:00
parent d75cabfeec
commit 82ebb697f3
94 changed files with 4498 additions and 749 deletions
+55
View File
@@ -0,0 +1,55 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class DashboardWidget extends Model
{
use HasFactory;
protected $fillable = [
'website_id',
'title',
'widget_type',
'config',
'sort_order',
'size',
];
protected function casts(): array
{
return [
'config' => 'array',
'sort_order' => 'integer',
];
}
public function website(): BelongsTo
{
return $this->belongsTo(Website::class);
}
public static array $types = [
'metric' => 'Single Metric',
'chart' => 'Visitors Chart',
'top_pages' => 'Top Pages',
'top_sources' => 'Top Sources',
'events' => 'Events Overview',
'conversions' => 'Goal Conversions',
'new_vs_returning' => 'New vs Returning',
'browsers' => 'Browsers',
'countries' => 'Countries',
];
public static array $metrics = [
'page_views' => 'Page Views',
'visitors' => 'Unique Visitors',
'sessions' => 'Sessions',
'bounce_rate' => 'Bounce Rate',
'avg_duration' => 'Avg. Duration',
'avg_pages' => 'Pages / Session',
];
}