@extends('layout.master')
@section('content')
@php
$userType = \App\Helpers\Helpers::getUserRole()->type_id ?? [];
$userAccess = \App\Helpers\Helpers::getUserAccess() ?? [];
$access = $userAccess['accesses'] ?? [];
@endphp
@if (!empty($visitors_list))
{{-- @php
$view = !empty($userType)
? ($userType == 1 ||
($userType == 2 && (!empty($access['visitors']) && in_array(2, $access['visitors'])))
? ''
: 'hide')
: 'hide';
$edit = !empty($userType)
? ($userType == 1 ||
($userType == 2 && (!empty($access['visitors']) && in_array(3, $access['visitors'])))
? ''
: 'hide')
: 'hide';
$delete = !empty($userType)
? ($userType == 1 ||
($userType == 2 && (!empty($access['visitors']) && in_array(4, $access['visitors'])))
? ''
: 'hide')
: 'hide';
@endphp --}}
@php
$view = !empty($userType)
? ($userType == 2 && (empty($access['visitors']) || !in_array(2, $access['visitors']))
? 'hide'
: '')
: 'hide';
$edit = !empty($userType)
? ($userType == 2 && (empty($access['visitors']) || !in_array(3, $access['visitors']))
? 'hide'
: '')
: 'hide';
$delete = !empty($userType)
? ($userType == 2 && (empty($access['visitors']) || !in_array(4, $access['visitors']))
? 'hide'
: '')
: 'hide';
@endphp
@include('visitors.table')
@else