@extends('layouts.sadmin') @section('title', 'Subscription') @section('content')

Subscription

Manage company groups and tenant subscriptions

Add Company
{{-- Search / Filter Bar --}}
{{-- Stats Row --}}
@foreach([ ['label'=>'Total', 'val'=>$companies->total(), 'bg'=>'#EBF3FB','color'=>'#1B4F8A'], ['label'=>'Active', 'val'=>$companies->where('status','active')->count(), 'bg'=>'#d1e7dd','color'=>'#0a3622'], ['label'=>'Expired', 'val'=>$companies->where('status','expired')->count(), 'bg'=>'#f8d7da','color'=>'#842029'], ['label'=>'Inactive', 'val'=>$companies->whereIn('status',['suspended','trial'])->count(),'bg'=>'#e2e3e5','color'=>'#41464b'], ] as $stat)
{{ $stat['label'] }}
{{ $stat['val'] }}
@endforeach
{{-- Groups of Companies --}}
Groups of Companies
Create groups to assign multiple companies under one umbrella.
@forelse($groups as $group) @empty @endforelse
Group ID Group name Member companies Actions
{{ $group->group_code }} {{ $group->name }} {{ $group->companies->pluck('name')->implode(', ') ?: '—' }}
@csrf @method('DELETE')
No company groups yet. Create one to tag companies.
{{-- Companies --}}
Companies
Click a row to open the company, or use the action buttons.
@forelse($companies as $i => $company) @empty @endforelse
# Company Group Code Contact Users Concurrent Status Subscription / Trial Actions
{{ $companies->firstItem() + $i }}
{{ $company->name }}
@if($company->country)
{{ $company->country }}
@endif
@if($company->group)
{{ $company->group->group_code }}
{{ $company->group->name }}
@else @endif
{{ $company->company_code }} @if($company->email)
{{ $company->email }}
@endif @if($company->phone)
{{ $company->phone }}
@endif
{{ $company->users_count }} {{ $company->subscription?->max_concurrent_users ?? 5 }} {{ ucfirst($company->status) }} @if($company->subscription?->subscription_ends_at) @php $exp = $company->subscription->subscription_ends_at; @endphp
{{ $exp->format('d M Y') }} @if($exp->isPast()) Expired @elseif($exp->diffInDays() <= 30) {{ $exp->diffInDays() }}d left @endif
@elseif($company->subscription?->trial_ends_at) @php $trial = $company->subscription->trial_ends_at; @endphp
Trial: {{ $trial->format('d M Y') }} @if(!$trial->isPast()) {{ $trial->diffInDays() }}d left @endif
@else @endif
@csrf @method('PATCH')
No companies found
Create First Company
@if($companies->hasPages())
{{ $companies->withQueryString()->links() }}
@endif
@endsection @push('scripts') @endpush