@extends('layouts.app') @section('content')
@include('shared.messages')

{{__('texte.courses_arr.history.show_course_history')}}

@foreach($courseHistory as $history) @if($history->key == 'created_at' && !$history->old_value) @elseif($history->key == 'deleted_at' && !$history->old_value) @else @endif @endforeach
{{ __('texte.courses_arr.history.course_created')}} {{__('texte.courses_arr.history.by')}} {{$history->userResponsible()->name }} {{__('texte.courses_arr.history.on')}} {{ date("d.m.Y",strtotime($history->created_at)) }} {{__('texte.courses_arr.history.at')}} {{ date("H:i",strtotime($history->created_at)) }}
{{ __('texte.courses_arr.history.course_deleted')}} {{ __('texte.courses_arr.history.by')}} {{ $history->userResponsible()->name }} {{ __('texte.courses_arr.history.on')}} {{ date("d.m.Y",strtotime($history->created_at)) }} {{ __('texte.courses_arr.history.at')}} {{ date("H:i",strtotime($history->created_at)) }}
{{ $history->userResponsible()->name }} {{__('texte.courses_arr.history.changed_field')}} @switch($history->fieldName()) @case('driver') {{__('texte.courses_arr.history.driver')}} {{__('texte.courses_arr.history.from')}} {{ $history->oldValue()==null ? '" "' : $drivers[$history->oldValue()]->name}} {{__('texte.courses_arr.history.to')}} {{ $drivers[$history->newValue()]->name}} @break @case('vehicle') {{__('texte.courses_arr.history.vehicle')}} {{__('texte.courses_arr.history.from')}} {{ $history->oldValue()==null ? '" "' : $vehicles[$history->oldValue()]->make.' '.$vehicles[$history->oldValue()]->model.' '.$vehicles[$history->oldValue()]->reg_number}} {{__('texte.courses_arr.history.to')}} {{ $vehicles[$history->newValue()]->make.' '.$vehicles[$history->newValue()]->model.' '.$vehicles[$history->newValue()]->reg_number}} @break @case('orders') {{__('texte.courses_arr.history.orders')}} {{__('texte.courses_arr.history.from')}} {{ $history->oldValue()==null ? '" "' : $history->oldValue()}} {{__('texte.courses_arr.history.to')}} {{ $history->newValue() }} @break @default {{$history->fieldName()}} {{__('texte.courses_arr.history.from')}} {{ $history->oldValue()==null ? '" "' : $history->oldValue()}} {{__('texte.courses_arr.history.to')}} {{ $history->newValue() }} @break @endswitch {{__('texte.courses_arr.history.on')}} {{ date("d.m.Y",strtotime($history->created_at)) }} {{__('texte.courses_arr.history.at')}} {{ date("H:i",strtotime($history->created_at)) }}
@endsection