@extends('layouts.admin') @section('content')

{{ $title }}

@if(!empty($user['id'])) View Role History @endif
@if(!empty($error))

{{ $error }}

@endif
@csrf @if(!empty($user['id'])) @endif
@if(!empty($user['id']))

Leave blank to keep the current password

@endif
@if(!is_array($user) && !empty($user->pending_roles_id)) @php $pendingRole = \Spatie\Permission\Models\Role::find($user->pending_roles_id); @endphp
Note: This user has a pending role change to {{ $pendingRole->name ?? 'Unknown' }}
@endif
@if(!empty($user->rolechangedate ?? '')) @php $expiryDate = \Carbon\Carbon::parse($user->rolechangedate); $isExpired = $expiryDate->isPast(); $daysUntilExpiry = abs($expiryDate->diffInDays(now())); $totalHours = abs($expiryDate->diffInHours(now())); $hoursUntilExpiry = abs($totalHours % 24); @endphp @if($isExpired) Expired @elseif($daysUntilExpiry <= 7) Expiring Soon @elseif($daysUntilExpiry <= 30) Active @else Active @endif @else No Expiry @endif
@if(!empty($user->rolechangedate ?? ''))

@if($isExpired) Role expired {{ $expiryDate->diffForHumans() }} @else Role expires {{ $expiryDate->diffForHumans() }} @endif

{{ $expiryDate->format('F j, Y') }} {{ $expiryDate->format('g:i A') }}

@if($daysUntilExpiry <= 7 && !$isExpired)

{{ $daysUntilExpiry }} day{{ $daysUntilExpiry != 1 ? 's' : '' }} and {{ $hoursUntilExpiry }} hour{{ $hoursUntilExpiry != 1 ? 's' : '' }} remaining

@endif
@else

Leave empty for permanent role assignment, or use quick actions above to set an expiry date and time.

@endif
@if(!is_array($user)) @php $allPendingRoles = $user->getAllPendingStackedRoles(); @endphp @if($allPendingRoles->count() > 0)
SCHEDULED
@foreach($allPendingRoles as $index => $pendingRoleInfo)
{{ $index + 1 }} {{ $pendingRoleInfo['role_name'] }}
Starts: {{ $pendingRoleInfo['start_date']->format('M j, Y g:i A') }}
@if($pendingRoleInfo['end_date'])
Ends: {{ $pendingRoleInfo['end_date']->format('M j, Y g:i A') }}
@endif
Time until activation: {{ $pendingRoleInfo['start_date']->diffForHumans() }}
@endforeach

These roles will automatically activate in sequence as each previous role expires

@if(!empty($user->pending_roles_id)) @endif
@elseif(!empty($user->pending_roles_id) && !empty($user->pending_role_start_date)) {{-- Fallback to old display if no history records but pending_roles_id is set --}}
SCHEDULED
@php $pendingRole = \Spatie\Permission\Models\Role::find($user->pending_roles_id); $pendingStartDate = \Carbon\Carbon::parse($user->pending_role_start_date); $daysUntilActivation = $pendingStartDate->diffInDays(now()); @endphp
Will change to: {{ $pendingRole->name ?? 'Unknown' }}
Activation date: {{ $pendingStartDate->format('M j, Y g:i A') }}
Time until activation: {{ $pendingStartDate->diffForHumans() }}

This role will automatically activate when the current role expires

@endif @endif @if(!is_array($user) && !empty($user->rolechangedate) && \Carbon\Carbon::parse($user->rolechangedate)->isFuture())
@endif @if(!empty($user['id']))

Total grabs is read-only and automatically tracked

API Requests

{{ is_array($user) ? ($user['daily_api_count'] ?? 0) : ($user->daily_api_count ?? 0) }}

In the last 24 hours

Downloads

{{ is_array($user) ? ($user['daily_download_count'] ?? 0) : ($user->daily_download_count ?? 0) }}

In the last 24 hours

These counters show activity from the past 24 hours and are automatically updated.

@endif
@if(!empty($user['id']))
movieview ?? 0)) ? 'checked' : '' }} class="h-4 w-4 text-blue-600 dark:text-blue-400 focus:ring-blue-500 border-gray-300 dark:border-gray-600 rounded">
musicview ?? 0)) ? 'checked' : '' }} class="h-4 w-4 text-blue-600 dark:text-blue-400 focus:ring-blue-500 border-gray-300 dark:border-gray-600 rounded">
gameview ?? 0)) ? 'checked' : '' }} class="h-4 w-4 text-blue-600 dark:text-blue-400 focus:ring-blue-500 border-gray-300 dark:border-gray-600 rounded">
consoleview ?? 0)) ? 'checked' : '' }} class="h-4 w-4 text-blue-600 dark:text-blue-400 focus:ring-blue-500 border-gray-300 dark:border-gray-600 rounded">
bookview ?? 0)) ? 'checked' : '' }} class="h-4 w-4 text-blue-600 dark:text-blue-400 focus:ring-blue-500 border-gray-300 dark:border-gray-600 rounded">
xxxview ?? 0)) ? 'checked' : '' }} class="h-4 w-4 text-blue-600 dark:text-blue-400 focus:ring-blue-500 border-gray-300 dark:border-gray-600 rounded">
@endif
Cancel
@endsection