@extends('layouts.app') @section('content')
{{ $isSuperAdmin ? 'All Shared Subscriptions' : 'My Shared Subscriptions' }}
@php $legacyRole = strtolower(trim((string) auth()->user()->role)); $canCreateSubscription = auth()->user()->can('create subscription') || auth()->user()->hasAnyRole(['user', 'member', 'owner', 'admin', 'super admin']) || in_array($legacyRole, ['user', 'member', 'owner', 'admin', 'super admin'], true); @endphp @if(! $isSuperAdmin && $canCreateSubscription) New Listing @endif
@can('view subscription')
count() > 0) id="dashboard-shared-subscriptions-table" @endif class="table"> @if($isSuperAdmin)@endif @forelse($subscriptions as $item) @if($isSuperAdmin)@endif @empty @endforelse
OwnerService Plan Price/Slot Slots Visibility Status Action
{{ $item->owner?->name ?? 'N/A' }}{{ $item->service?->name ?? 'N/A' }} {{ $item->servicePlan?->name ?? 'N/A' }} ${{ number_format($item->price_per_slot,2) }} {{ $item->available_slots }}/{{ $item->total_slots }} {{ $item->is_public ? 'Public' : 'Private' }} {{ $item->status === 'draft' ? 'Pending' : ucfirst($item->status) }} @if($isSuperAdmin)
@can('update subscription') Manage @endcan @can('delete subscription')
@csrf @method('DELETE')
@endcan
@else - @endif
No shared subscriptions yet.
@else
You do not have permission to view subscriptions.
@endcan
@endsection @if($subscriptions->count() > 0) @push('script') @endpush @endif