@php
$pageConfigs = ['navbarType' => 'hidden', 'contentLayout' => 'wide'];
$configData = Helper::appClasses();
$courier = $courier ?? $user->courier;
$metrics = $metrics ?? [
'active_orders' => 0,
'delivered_today' => 0,
'delivered_30d' => 0,
'urgent_30d' => 0,
];
$statusLabel = 'Desactivado';
$statusTone = 'danger';
if ($courier && $courier->is_active) {
if ($courier->is_online) {
$statusLabel = 'En linea';
$statusTone = 'success';
} else {
$statusLabel = 'Desconectado';
$statusTone = 'neutral';
}
}
$bot = config('services.telegram.bot_username');
$token = $user->telegram_connect_token;
$connectUrl = $bot && $token ? ('https://t.me/' . $bot . '?start=' . $token) : null;
@endphp
@extends('layouts/layoutMaster')
@section('title', 'Perfil repartidor')
@section('content')
@if (session('success'))
{{ session('success') }}
@endif
@if ($errors->any())
@foreach ($errors->all() as $error)
{{ $error }}
@endforeach
@endif
Activos
{{ $metrics['active_orders'] ?? 0 }}
Hoy
{{ $metrics['delivered_today'] ?? 0 }}
Entregas 30d
{{ $metrics['delivered_30d'] ?? 0 }}
Urgentes 30d
{{ $metrics['urgent_30d'] ?? 0 }}
Saldo
€{{ number_format((float) ($courier?->wallet_balance ?? 0), 2) }}
Retirado
€{{ number_format((float) ($courier?->wallet_withdrawn ?? 0), 2) }}
Disponibilidad
Recibe pedidos solo en linea
Preferencias
Navegacion y carga maxima
Telegram
Avisos de pedidos en tiempo real
@if ($user->telegram_chat_id)
Conectado
{{ $user->telegram_connected_at ? $user->telegram_connected_at->format('d/m/Y H:i') : 'Sin fecha' }}
@else
No conectado
Vincula Telegram para recibir nuevos pedidos al instante.
@endif
@if ($connectUrl)
Conectar Telegram
Si no abre, busca @{{ $bot }} y envia /start.
@else
Falta configurar TELEGRAM_BOT_USERNAME en el entorno.
@endif
Sesion
Finaliza esta sesion en el dispositivo
@endsection
@section('page-style')
@endsection
@section('page-script')
@endsection