@if ($users->count() > 0)
| Status |
Name |
Email |
Level |
Phone |
Wallet Balance (₦) |
View Details |
@if (Auth::user()->id == 1)
Actions |
@endif
Fund Wallet |
Change Level |
@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 ($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 (Auth::user()->id == 1)
@if ($user->status !== 'activated')
@else
@endif
@if ($user->status !== 'disabled')
@else
@endif
|
@endif
|
|
{{-- Modal for activating user --}}
Do you want to reward the referrer for this user?
@endforeach
{{ $users->links() }}
@else
No registered users found.
@endif