{{-- @php--}}
{{-- use App\Models\UserMatrix;--}}
{{-- $matricesData = [];--}}
{{-- foreach ($data['matrices'] as $matrix) {--}}
{{-- if(UserMatrix::where('matrix_id', $matrix->id)--}}
{{-- ->where('user_id', auth()->id())--}}
{{-- ->where('index', 0)--}}
{{-- ->exists()){--}}
{{-- $maxIndex = UserMatrix::where('matrix_id', $matrix->id)->max('index');--}}
{{-- $usersByIndex = [];--}}
{{-- for ($index = 0; $index <= $maxIndex; $index++) {--}}
{{-- $users = UserMatrix::where('matrix_id', $matrix->id)--}}
{{-- ->where('index', $index)--}}
{{-- ->get();--}}
{{-- $usersByIndex[$index] = $users;--}}
{{-- }--}}
{{-- }--}}
{{-- }--}}
{{-- @endphp--}}
@if(\Illuminate\Support\Facades\Auth::user()->hasRole('admin'))
@else
@endif
Latest Payment
) }})