@extends('admin.layouts.master') @php $can_update = Gate::allows('update', $config) ?? null; $active_shipping_methods = $config->shippingMethods->pluck('id')->toArray(); $has_config = false; @endphp @section('content')

@lang('packages.shippo.configurations')

@foreach ($shipping_method_types as $type_id => $type) @php $shipping_providers = $shipping_methods->where('type', $type_id)->where('enabled', 1); $logo_path = sys_image_path('shipping-method-types') . "{$type_id}.svg"; @endphp @if ($shipping_providers->count())
@foreach ($shipping_providers as $shipping_provider) @php $has_config = false; $logo_path = sys_image_path('shipping-methods') . "{$shipping_provider->code}.png"; @endphp
  • @if (File::exists($logo_path)) {{ $type }} @else

    {{ $shipping_provider->name }}

    @endif

    {!! $shipping_provider->description !!}

    @if (in_array($shipping_provider->id, $active_shipping_methods)) @if ($can_update) @switch ($shipping_provider->code) @case ('shippo') @php $has_config = true; @endphp @break @endswitch @unless ($has_config)
    @lang('app.payment_method_configuration_issue')
    @endunless @if ($shipping_provider->code == 'shippo') {{ trans('app.update') }} @else {{ trans('app.update') }} @endif {{ trans('app.deactivate') }}
    @include('shippo::_btn_fetch_carriers')
    @else {{ trans('app.active') }} @endif @else @if ($can_update) {{ $has_config ? trans('app.reactivate') : trans('app.activate') }} @else {{ trans('app.inactive') }} @endif @endif
@endforeach
@unless ($loop->last)
@endunless @endif @endforeach
@endsection