@extends('layouts.app') @section('content') @include('inc.h') @include('inc.s')
All Registered Users
@if ($users->count() > 0)
@if (Auth::user()->id == 1) @endif @foreach ($users as $user) @php $lastLogin = $user->last_login; $status = 'Inactive'; if ($lastLogin) { $now = \Carbon\Carbon::now(); $lastLoginTime = \Carbon\Carbon::parse($lastLogin); $diffInDays = $now->diffInDays($lastLoginTime); if ($diffInDays <= 3) { $status = 'Active'; } elseif ($diffInDays <= 7) { $status = 'Recently Active'; } } $wallet = $user->wallets->pluck('amount')->sum(); $balance = $wallet ? number_format($wallet, 2) : '0.00'; @endphp @if (Auth::user()->id == 1) @endif {{-- Modal for activating user --}} @endforeach
Status Name Email Level Phone Wallet Balance (₦) View DetailsActionsFund Wallet Change Level
@if ($status === 'Active') Active @elseif ($status === 'Recently Active') Recently Active @else Inactive @endif {{ $user->name }} {{ $user->email }} {{ ucfirst($user->role) }} @if ($user->admin == 1) Small Admin @endif {{ $user->phone ?? 'N/A' }} ₦{{ $balance }}
@if ($user->status !== 'activated') @else @endif
@csrf @method('DELETE')
@if ($user->status !== 'disabled')
@csrf @method('PATCH')
@else
@csrf @method('PATCH')
@endif
@csrf @method('PATCH')
{{ $users->links() }}
@else

No registered users found.

@endif
@endsection