@extends('layouts.admin') @section('title', 'Edit User: ' . $user->name) @section('header_title', 'Edit User') @section('content')

Edit User: {{ $user->name }}

@csrf @method('PUT')
@error('name') {{ $message }} @enderror
@error('email') {{ $message }} @enderror
@if(!Auth::user()->isSuperAdmin())

Only Super Admins can change roles.

@endif @error('role') {{ $message }} @enderror
@if(Auth::user()->isSuperAdmin() && isset($assignableRoles))

Hold Ctrl (or Cmd on Mac) to select multiple roles. These grant specific feature permissions.

@error('spatie_roles') {{ $message }} @enderror
@endif @if(Auth::user()->isSuperAdmin() && $user->role === 'admin')

Manage 'Admin' Role Module Permissions

Warning: Changes made below will affect permissions for all users who have the 'Admin' role, not just '{{ $user->name }}'.

@forelse($modules as $module)
getName(), old('modules', $assignedModules)) ? 'checked' : '' }} class="h-4 w-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500 dark:bg-gray-700 dark:border-gray-600">
@empty

No modules available to assign permissions.

@endforelse
@endif
@error('password') {{ $message }} @enderror
Cancel
@if(Auth::user()->isSuperAdmin())

Manage User Subscription

@if($currentSubscription)

Current Active Subscription:

Plan: {{ $currentSubscription->plan->name ?? 'N/A' }}
Status: {{ $currentSubscription->status }}
Ends At: {{ $currentSubscription->ends_at ? $currentSubscription->ends_at->toFormattedDateString() : 'N/A' }}
Gateway: {{ str_replace('_', ' ', $currentSubscription->payment_gateway) }}

@csrf
@else

This user does not currently have an active subscription.

@endif
@csrf
@error('subscription_plan_id') {{ $message }} @enderror
{{-- Optional: Add fields for custom start/end dates if needed --}} {{--
@error('custom_ends_at') {{ $message }} @enderror
--}}
@endif {{-- Credit Balance Management --}} @if(Auth::user()->isSuperAdmin() && function_exists('setting') && setting('credits_system_enabled', '0') == '1')

Credit Balance Management

Current Credit Balance: {{ $user->credit_balance ?? 0 }} credits

@csrf
@error('credit_adjustment_amount')

{{ $message }}

@enderror
@error('credit_adjustment_description')

{{ $message }}

@enderror
@endif {{-- Wallet Balance Management --}} @if(Auth::user()->isSuperAdmin() && function_exists('setting') && setting('wallet_system_enabled', '0') == '1')

Wallet Balance Management

Current Wallet Balance: ${{ number_format($user->wallet_balance ?? 0, 2) }}

@csrf
@error('wallet_adjustment_amount')

{{ $message }}

@enderror
@error('wallet_adjustment_description')

{{ $message }}

@enderror
@endif
@endsection