@extends('layouts.app') @section('title', auth()->user()->isManager() ? 'My Sellers' : 'User Management') @section('content')
| Name | Role | @if(auth()->user()->isAdmin()) Assigned Stores @else Assign Platform @endif | Created | @if(auth()->user()->isAdmin())Actions | @endif|
|---|---|---|---|---|---|
|
{{ $user->name }}
@if($user->company_name)
{{ $user->company_name }}
@endif
|
{{ $user->email }}
|
@if($user->role === 'admin') Admin @elseif($user->role === 'manager') Manager @else Seller @endif |
@if($user->role === 'admin')
@if(auth()->user()->isAdmin())
All Stores
@else
All Platforms
@endif
@elseif($user->role === 'manager')
@php
$storesCount = $user->stores_count ?? $user->stores()->count();
$pagesCount = $user->salesPages()->count();
$sellersCount = $user->managedSellers()->count();
$tiktokShopsCount = $user->tiktok_shops_count ?? $user->tiktokShops()->count();
$platforms = [];
if ($storesCount > 0) $platforms[] = $storesCount . ' ' . Str::plural('store', $storesCount);
if ($pagesCount > 0) $platforms[] = $pagesCount . ' ' . Str::plural('page', $pagesCount);
if ($sellersCount > 0) $platforms[] = $sellersCount . ' ' . Str::plural('seller', $sellersCount);
if ($tiktokShopsCount > 0) $platforms[] = $tiktokShopsCount . ' TikTok ' . Str::plural('Shop', $tiktokShopsCount);
@endphp
@if(count($platforms) > 0)
@foreach($platforms as $platform)
{{ $platform }}
@endforeach
@else
No platforms assigned
@endif
@else
@php
$storesCount = $user->stores()->count();
$pagesCount = $user->salesPages()->count();
$platforms = [];
if ($storesCount > 0) $platforms[] = $storesCount . ' ' . Str::plural('store', $storesCount);
if ($pagesCount > 0) $platforms[] = $pagesCount . ' ' . Str::plural('page', $pagesCount);
@endphp
@if(count($platforms) > 0)
@foreach($platforms as $platform)
{{ $platform }}
@endforeach
@else
No platforms assigned
@endif
@endif
|
{{ $user->created_at->format('M d, Y') }} | @if(auth()->user()->isAdmin())
@if($user->id !== auth()->id())
@endif
Edit
@if($user->id !== auth()->id())
@else
Current User
@endif
|
@endif
No users found.