execute((int) auth()->id(), app(Clock::class)->today()); } /** * @return list */ public function quickLinks(): array { $links = [ ['route' => 'jobs.quick', 'label' => __('dashboard.links.quick_intake'), 'icon' => 'bolt', 'ability' => 'jobs.manage'], ['route' => 'jobs.create', 'label' => __('dashboard.links.new_job'), 'icon' => 'plus', 'ability' => 'jobs.manage'], ['route' => 'time.week', 'label' => __('dashboard.links.time'), 'icon' => 'clock', 'ability' => 'time.use'], ['route' => 'sales.sell', 'label' => __('dashboard.links.quick_sale'), 'icon' => 'shopping-cart', 'ability' => 'sales.use'], ['route' => 'jobs.calendar', 'label' => __('dashboard.links.calendar'), 'icon' => 'calendar-days', 'ability' => 'jobs.view'], ]; return array_values(array_map( fn (array $link): array => ['route' => $link['route'], 'label' => $link['label'], 'icon' => $link['icon']], array_filter($links, fn (array $link): bool => Gate::allows($link['ability'])), )); } public function dayName(string $day): string { return __('time.days')[(int) (new DateTimeImmutable($day))->format('N') - 1]; } public function render(): mixed { return $this->view()->title(__('dashboard.title')); } }; ?>

{{ __('dashboard.greeting', ['name' => auth()->user()->name]) }}

@php($overview = $this->overview)

{{ __('dashboard.tasks.title') }}

@if (! $overview->hasTasks())

{{ __('dashboard.tasks.none') }}

@endif @foreach (['overdue' => $overview->overdue, 'soon' => $overview->soon, 'this_week' => $overview->thisWeek] as $group => $tasks) @if ($tasks !== [])

@if ($group === 'overdue')

    @foreach ($tasks as $task)
  • {{ $task->title }} {{ $task->jobNumber }} {{ $task->jobName }} {{ __('jobs.tasks.statuses.'.$task->status) }} @if ($task->dueOn !== null) {{ __('dashboard.tasks.due', ['date' => $this->dateLabel($task->dueOn)]) }} @endif @if ($task->plannedFrom !== null) {{ __('dashboard.tasks.starts', ['date' => $this->dateLabel($task->plannedFrom)]) }} @endif @if ($task->isLate) @endif
  • @endforeach
@endif @endforeach @if ($overview->laterCount > 0)

{{ trans_choice('dashboard.tasks.later', $overview->laterCount, ['count' => $overview->laterCount]) }}

{{ __('dashboard.tasks.to_calendar') }}

@endif

{{ __('dashboard.week.title') }}

@foreach (array_keys($overview->week->days) as $day) @endforeach @foreach ($overview->week->days as $quarters) @endforeach
{{ __('dashboard.week.caption', ['from' => $this->dateLabel($overview->week->monday)]) }}
{{ $this->dayName($day) }} {{ (new DateTimeImmutable($day))->format('j.n.') }}
{{ $this->hours($quarters) }}

{{ __('dashboard.week.total', ['hours' => $this->hours($overview->week->totalQuarters)]) }} @if ($overview->week->unapprovedQuarters > 0) @endif

{{ __('dashboard.week.open') }}

{{ __('dashboard.jobs.title') }}

@if ($overview->jobs === [])

{{ __('dashboard.jobs.none') }}

@else
    @foreach ($overview->jobs as $job)
  • {{ $job->number }} {{ $job->name }} {{ $job->customerName }} {{ __('jobs.statuses.'.$job->status) }} @if ($job->dueOn !== null) {{ __('dashboard.jobs.due', ['date' => $this->dateLabel($job->dueOn)]) }} @endif @if ($job->isLate) @endif
  • @endforeach
@endif

{{ trans_choice('dashboard.jobs.all', $overview->jobCount, ['count' => $overview->jobCount]) }}

@can('dashboard.management') {{-- Loaded right after the page, not only when scrolled to. --}} @endcan