@extends('layouts.main') @section('title', 'Company Management') @section('content')

Company Management

Manage all company users
@if(session('success')) @endif @if(session('error')) @endif
@if($companies->count() > 0) @foreach($companies as $index => $company) is_storage_full ?? false) title="⚠️ Storage Full ({{ number_format($company->storage_usage_percentage ?? 0, 1) }}%) - Immediate action required!" @endif> @endforeach
# Company Contact Workspaces Subscription CU (Current Month) Duration (Current Month) Actions
{{ $companies->firstItem() + $index }} {{ $company->company ?? 'Not Set' }}
{{ strtoupper(substr($company->name, 0, 1)) }}
{{ $company->name }} @if($company->is_storage_full ?? false) 100% @elseif(($company->storage_usage_percentage ?? 0) >= 90) {{ number_format($company->storage_usage_percentage, 0) }}% @elseif(($company->storage_usage_percentage ?? 0) >= 80) {{ number_format($company->storage_usage_percentage, 0) }}% @endif
{{ $company->email }} @if($company->email_verified_at) @else @endif @if(($company->storage_usage_percentage ?? 0) > 0)
Storage: {{ number_format($company->storage_used ?? 0, 2) }} GB ({{ number_format($company->storage_usage_percentage, 1) }}%) / {{ number_format($company->storage_limit ?? 0, 2) }} GB
@endif
{{ $company->workspaces->count() }} workspace(s) @if($company->subscriptionPlans->count() > 0) @php $subscription = $company->subscriptionPlans->first(); @endphp {{ $subscription->title }} @else No Plan @endif {{ $company->current_month_cu ?? '0.00' }} {{ $company->current_month_duration ?? '0.00' }}
@csrf @method('DELETE')
Showing {{ $companies->firstItem() }} to {{ $companies->lastItem() }} of {{ $companies->total() }} entries
{{ $companies->links() }}
@else
No Companies Found

No company users have been created yet.

Create First Company
@endif
Company Statistics
Total Companies

{{ $companies->total() }}

Active Companies

{{ $companies->where('email_verified_at', '!=', null)->count() }}

Pending Verification

{{ $companies->where('email_verified_at', null)->count() }}

Total Workspaces

{{ $companies->sum(function($company) { return $company->workspaces->count(); }) }}

@endsection @section('scripts') @endsection