@extends('layouts.adminlte.adminlte') @section('title') Users @endsection @section('content_header') @parent

Users

@php $n_agents = \App\Models\User::where('user_type', 'agent')->where('banned', false)->count(); $n_managers = \App\Models\User::where('user_type', 'manager')->where('banned', false)->count(); $n_sellers = \App\Models\User::where('user_type', 'seller')->where('banned', false)->count(); @endphp @if(auth()->user()->user_type == 'admin')

{{$n_agents}} agents, {{$n_managers}} managers, {{$n_sellers}} sellers

@endif @endsection @section('table')
@if (auth()->user()->user_type == 'admin') @endif @if (auth()->user()->user_type == "admin") @endif @foreach($users as $user) @if ($user->id != auth()->user()->id) @if (auth()->user()->user_type == 'admin') @endif @if (in_array(auth()->user()->user_type, ["admin"])) @endif @endif @endforeach
ID Name E-mail User typeAdded byBanned Telegram Wechat Sheet API key
{{$user->id}} {{$user->name}} {{$user->email}} {{ucfirst($user->user_type)}}{{$added_by ? $added_by->name : ''}} @if($user->banned) @endif @if ($user->telegram_username)

{{"@$user->telegram_username"}}

@endif
{{$user->wechat}} @if (in_array($user->user_type, ['manager', 'seller', 'agent']) && isset($user->spreadsheet['id'])) spreadsheet['id']}}" target="_blank"> @endif {!!Form::open(['action' => ['App\Http\Controllers\CustomUsersController@destroy', $user->id], 'method' => 'POST'])!!} {{Form::hidden('_method', 'DELETE')}} {{Form::submit($user->banned ? 'UNBAN' : 'BAN', ['class' => 'btn btn-danger'])}} {!!Form::close()!!}
@endsection @section('content') @yield('table') @endsection @section('js') @parent @stop @section('css') @parent @stop