@extends('layouts.manager') @section('title','Кабінети') @section('page_title','Кабінети') @push('head') @endpush @section('content') @php /** @var \Illuminate\Support\Collection|\Illuminate\Database\Eloquent\Collection $cabinets */ $totalCabinets = $cabinets->count(); $withTeamleads = $cabinets->filter(fn($cab) => $cab->teamLeads && $cab->teamLeads->count())->count(); $withDay = $cabinets->whereNotNull('day_operator')->count(); $withEven = $cabinets->whereNotNull('evening_operator')->count(); $withNight = $cabinets->whereNotNull('night_operator')->count(); $pct = fn($a,$b) => $b > 0 ? round(($a / $b) * 100) : 0; $pctDay = $pct($withDay, $totalCabinets); $pctEven = $pct($withEven, $totalCabinets); $pctNight = $pct($withNight, $totalCabinets); @endphp
| Кабінет | Тімлід | День | Вечір | Ніч | Дії |
|---|---|---|---|---|---|
|
{{ $cab->name }}
@if(!empty($cab->slug))
{{ $cab->slug }}
@endif
|
@if($cab->teamLeads && $cab->teamLeads->count())
@foreach($cab->teamLeads as $lead)
{{ $lead->name }}
@endforeach
@else
—
@endif
|
@if($cab->day_operator)
{{ $cab->day_operator }}
@if($cab->day_tg_username)
{{ $cab->day_tg_username }}
@endif
@else
Немає
@endif
|
@if($cab->evening_operator)
{{ $cab->evening_operator }}
@if($cab->evening_tg_username)
{{ $cab->evening_tg_username }}
@endif
@else
Немає
@endif
|
@if($cab->night_operator)
{{ $cab->night_operator }}
@if($cab->night_tg_username)
{{ $cab->night_tg_username }}
@endif
@else
Немає
@endif
|
|