@extends('backend.layouts.app') @section('content') @if(env('MAIL_USERNAME') == null && env('MAIL_PASSWORD') == null)
{{translate('Please Configure SMTP Setting to work all email sending functionality')}}, {{ translate('Configure Now') }}
@endif @if(Auth::user()->user_type == 'admin' || in_array('1', json_decode(Auth::user()->staff->role->permissions)))
Total Usuarios Registrados
{{ \App\Models\User::where('user_type', 'staff')->count() }}
Total Empresas Registradas
{{ \App\Models\Empresa::count() }}
Total Salidas de Hoy
@php $hoy = date('Y-m-d'); // Contar salidas regulares de hoy $salidasHoyRegulares = \App\Models\Salida::where('fecha', '=', $hoy)->where('activo', 1)->where('recurrente', 0)->count(); // Obtener el día de la semana actual en minúsculas (por ejemplo: "monday", "tuesday", etc.) $diaActual = strtolower(date('l')); // Contar salidas recurrentes que ocurren hoy $salidasHoyRecurrentes = \App\Models\Salida::where('recurrente', 1) ->whereRaw("JSON_CONTAINS(dias_semana, '\"" . $diaActual . "\"')") ->where('activo', 1) ->count(); // Sumar el total de salidas de hoy (regulares + recurrentes) $totalSalidasHoy = $salidasHoyRegulares + $salidasHoyRecurrentes; @endphp
{{ $totalSalidasHoy }}
Total Llegadas de Hoy
@php $hoy = date('Y-m-d'); // Contar llegadas regulares de hoy $llegadasHoyRegulares = \App\Models\Llegada::where('fecha', '=', $hoy)->where('activo', 1)->where('recurrente', 0)->count(); // Obtener el día de la semana actual en minúsculas (por ejemplo: "monday", "tuesday", etc.) $diaActual = strtolower(date('l')); // Contar llegadas recurrentes que ocurren hoy $llegadasHoyRecurrentes = \App\Models\Llegada::where('recurrente', 1) ->whereRaw("JSON_CONTAINS(dias_semana, '\"" . $diaActual . "\"')") ->where('activo', 1) ->count(); // Sumar el total de llegadas de hoy (regulares + recurrentes) $totalLlegadasHoy = $llegadasHoyRegulares + $llegadasHoyRecurrentes; @endphp
{{ $totalLlegadasHoy }}
@endif @endsection @section('script') @endsection