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

{{__('texte.producers_arr.history.show_producer_history')}}

@foreach($producerHistory as $history) @if($history->key == 'created_at' && !$history->old_value) @elseif($history->key == 'deleted_at' && !$history->old_value) @else @endif @endforeach
{{ __('texte.producers_arr.history.producer_created')}} {{__('texte.producers_arr.history.by')}} {{$history->userResponsible()->name }} {{__('texte.producers_arr.history.on')}} {{ date("d.m.Y",strtotime($history->created_at)) }} {{__('texte.producers_arr.history.at')}} {{ date("H:i",strtotime($history->created_at)) }}
{{ __('texte.producers_arr.history.producer_deleted')}} {{ __('texte.producers_arr.history.by')}} {{ $history->userResponsible()->name }} {{ __('texte.producers_arr.history.on')}} {{ date("d.m.Y",strtotime($history->created_at)) }} {{ __('texte.producers_arr.history.at')}} {{ date("H:i",strtotime($history->created_at)) }}
{{ $history->userResponsible()->name }} {{__('texte.producers_arr.history.changed_field')}} @switch($history->fieldName()) @case('name') {{__('texte.producers_arr.history.name')}} {{__('texte.producers_arr.history.from')}} {{ $history->oldValue()==null ? '" "' : $history->oldValue()}} {{__('texte.producers_arr.history.to')}} {{ $history->newValue() }} @break @case('contragent') {{__('texte.producers_arr.history.contragent')}} {{__('texte.producers_arr.history.from')}} {{ $history->oldValue()==null ? '" "' : ($contragents[$history->oldValue()]->company_name!=null ? $contragents[$history->oldValue()]->company_name : $contragents[$history->oldValue()]->user->name )}} {{__('texte.objects_arr.history.to')}} {{ $contragents[$history->newValue()]->company_name }} @break @case('description') {{__('texte.producers_arr.history.description')}} {{__('texte.producers_arr.history.from')}} {{ $history->oldValue()==null ? '" "' : $history->oldValue()}} {{__('texte.producers_arr.history.to')}} {{ $history->newValue() }} @break @case('meta_title') {{__('texte.producers_arr.history.meta_title')}} {{__('texte.producers_arr.history.from')}} {{ $history->oldValue()==null ? '" "' : $history->oldValue()}} {{__('texte.producers_arr.history.to')}} {{ $history->newValue() }} @break @case('meta_keywords') {{__('texte.producers_arr.history.meta_keywords')}} {{__('texte.producers_arr.history.from')}} {{ $history->oldValue()==null ? '" "' : $history->oldValue()}} {{__('texte.producers_arr.history.to')}} {{ $history->newValue() }} @break @case('meta_description') {{__('texte.producers_arr.history.meta_description')}} {{__('texte.producers_arr.history.from')}} {{ $history->oldValue()==null ? '" "' : $history->oldValue()}} {{__('texte.producers_arr.history.to')}} {{ $history->newValue() }} @break @case('active') {{__('texte.producers_arr.history.active')}} {{__('texte.producers_arr.history.from')}} {{ $history->oldValue()==null ? '" "' : __('texte.replies_arr')[$history->oldValue()]}} {{__('texte.producers_arr.history.to')}} {{ __('texte.replies_arr')[$history->newValue()] }} @break @default {{$history->fieldName()}} {{__('texte.producers_arr.history.from')}} {{ $history->oldValue()==null ? '" "' : $history->oldValue()}} {{__('texte.producers_arr.history.to')}} {{ $history->newValue() }} @break @endswitch {{__('texte.producers_arr.history.on')}} {{ date("d.m.Y",strtotime($history->created_at)) }} {{__('texte.producers_arr.history.at')}} {{ date("H:i",strtotime($history->created_at)) }}
@endsection