@props(['activities'])
@forelse($activities as $activity) @php $link = null; if ($activity->type === 'appointment_created' || $activity->type === 'appointment_updated' || $activity->type === 'appointment_status_changed') { $appointmentId = $activity->metadata['appointment_id'] ?? null; if ($appointmentId) { $appointment = \App\Models\Appointment::find($appointmentId); if ($appointment) { $link = route('provider.appointments.edit', ['appointment_uuid' => $appointment->uuid, 'stepper' => 'vertical']); } } } if ($activity->type === 'payment_created' || $activity->type === 'payment_updated') { $paymentId = $activity->metadata['payment_id'] ?? null; if ($paymentId) { $payment = \App\Models\Payment::find($paymentId); if ($payment) { $link = route('provider.invoices.show', ['invoice_uuid' => $payment->uuid]); } } } @endphp @if($link) @else
@endif
@switch($activity->type) @case('client_created') @break @case('appointment_created') @case('appointment_updated') @case('appointment_status_changed') @break @case('payment_created') @case('payment_updated') @break @case('note_added') @case('note_updated') @case('note_deleted') @break @default @endswitch

{{ $activity->description }}

{{ $activity->created_at->format('d/m/y H:i') }}
@if($activity->metadata)
@if(isset($activity->metadata['service'])) {{ $activity->metadata['service'] }} @endif @if(isset($activity->metadata['date'])) {{ \Carbon\Carbon::parse($activity->metadata['date'])->format('d/m/Y à H:i') }} @endif @if(isset($activity->metadata['net_amount'])) {{ $activity->metadata['net_amount'] }} @elseif(isset($activity->metadata['amount'])) {{ $activity->metadata['amount'] }} @endif
@endif
@if($link)
@else
@endif @empty

Aucune activité

@endforelse