This commit is contained in:
Stefanescu Mihai
2026-03-18 13:32:36 +02:00
parent 6ad100d331
commit 274f6a378e
22 changed files with 1217 additions and 42 deletions
@@ -2,6 +2,8 @@
@php
$currentRange = request('range', '7d');
$currentRouteName = request()->route()->getName();
$currentRouteParams = request()->route()->parameters();
$presets = [
'today' => 'Today',
'7d' => 'Last 7 days',
@@ -34,7 +36,7 @@
<div class="p-2">
@foreach ($presets as $key => $label)
<a
href="{{ route('dashboard.show', ['website' => $website, 'range' => $key]) }}"
href="{{ route($currentRouteName, $currentRouteParams + ['range' => $key]) }}"
class="block rounded-md px-3 py-2 text-sm {{ $currentRange === $key ? 'bg-indigo-50 text-indigo-700 font-medium' : 'text-gray-700 hover:bg-gray-100' }}"
>
{{ $label }}
@@ -43,7 +45,7 @@
<div class="my-2 border-t border-gray-100"></div>
<form action="{{ route('dashboard.show', $website) }}" method="GET" class="px-3 py-2 space-y-3">
<form action="{{ route($currentRouteName, $currentRouteParams) }}" method="GET" class="px-3 py-2 space-y-3">
<input type="hidden" name="range" value="custom">
<div>
<label class="block text-xs font-medium text-gray-500 mb-1">From</label>