@extends('admin.layouts.app') @section('title', admin_trans('subscriptions')) @section('page-title', admin_trans('subscriptions_management')) @section('content')
@foreach(request()->except(['search', 'page']) as $key => $value) @if(is_array($value)) @foreach($value as $v) @endforeach @else @endif @endforeach
{{ admin_trans('export') }}

{{ admin_trans('filters') }}

@if(request('search'))@endif
@if($users->count() > 0) @php $usersArray = $users->map(function($user) { return [ 'id' => $user->id, 'name' => $user->name . ' (' . $user->email . ')' ]; })->toArray(); @endphp @endif
{{ admin_trans('apply_filters') }}
@if(request()->hasAny(['search', 'subscribable_type', 'type', 'user_id', 'date_from', 'date_to', 'sort']))
{{ admin_trans('clear_all_filters') }}
@endif
{{ admin_trans('delete') }} {{ admin_trans('clear') }}
@if ($subscriptions->isEmpty()) @else @foreach ($subscriptions as $subscription) @if($subscription->user)
{{ substr($subscription->user->name, 0, 1) }}
{{ $subscription->user->name }}
{{ $subscription->user->email }}
@else {{ admin_trans('deleted_user') }} @endif
@if($subscription->subscribable)
{{ $subscription->subscribable->name }}
ID: {{ $subscription->subscribable_id }}
@else {{ admin_trans('deleted_item') }} @endif
@php $typeVariant = match($subscription->type) { 'follow' => 'info', 'notify' => 'warning', default => 'secondary' }; @endphp {{ admin_trans($subscription->type) }} @php $modelClass = class_basename($subscription->subscribable_type); $subscribableVariant = match($modelClass) { 'Store' => 'primary', 'Brand' => 'warning', 'Category' => 'success', default => 'secondary' }; @endphp {{ admin_trans(strtolower($modelClass)) }}
{{ $subscription->created_at->format('d/m/Y') }}
{{ $subscription->created_at->diffForHumans() }}
@endforeach
@if ($subscriptions->hasPages())
@endif @endif
@endsection @push('scripts') @endpush