@hasanyrole('BranchOwner|BranchManager|BranchStaffMember') @php $user_session = session('restaurant'); // dd( $user_session ); $pos_type = $pos_access = $payment_setup = null; $location = auth()->user()->getLocationUserData(); $restaurant = $location->parent; switch ( $user_session['restaurant_pos_type'] ) { case '0': // eaterli pos $pos_type = $restaurant->pos_type; $pos_access = $restaurant->pos_access; $payment_setup = $restaurant->payment_setup; break; case '1': // square pos $pos_type = $restaurant->pos_type; $pos_access = $restaurant->pos_access; $payment_setup = $restaurant->payment_setup; break; case '2': // clover pos $pos_type = $restaurant->pos_type; $pos_access = $location->pos_access; $payment_setup = $restaurant->payment_setup; break; case '3': // other pos $pos_type = $restaurant->pos_type; $pos_access = $restaurant->pos_access; $payment_setup = $restaurant->payment_setup; break; default: // not in use break; } @endphp @else @php $user_session = session('restaurant'); $pos_type = $pos_access = $payment_setup = null; $restaurant = auth()->user()->getRestaurantData(); $location = $restaurant->primary_location; switch ( $user_session['restaurant_pos_type'] ) { case '0': // eaterli pos $pos_type = $restaurant->pos_type; $pos_access = $restaurant->pos_access; $payment_setup = $restaurant->payment_setup; break; case '1': // square pos $pos_type = $restaurant->pos_type; $pos_access = $restaurant->pos_access; $payment_setup = $restaurant->payment_setup; break; case '2': // clover pos $pos_type = $restaurant->pos_type; $pos_access = $location->pos_access; $payment_setup = $restaurant->payment_setup; break; case '3': // other pos $pos_type = $restaurant->pos_type; $pos_access = $restaurant->pos_access; $payment_setup = $restaurant->payment_setup; break; default: // not in use break; } @endphp @endhasanyrole @hasrole('Admin') @php $restaurant_id = auth()->user()->getRestaurantData()->id; $location_id = auth()->user()->getRestaurantPrimaryLocation()->id; @endphp @endhasrole @hasanyrole('BranchOwner|BranchManager|BranchStaffMember') @php $location = auth()->user()->getLocationUserData(); $location_id = $location->id; $restaurant_id = $location->restaurant_id; @endphp @endhasanyrole @php // dd( session('restaurant') ); /*if( auth()->user()->getRestaurantData() ) { $restaurant_id = auth()->user()->getRestaurantData()->id; $location_id = auth()->user()->getRestaurantPrimaryLocation()->id; } else if( auth()->user()->getLocationUserData() ) { $location = auth()->user()->getLocationUserData(); $location_id = $location->id; $restaurant_id = $location->restaurant_id; }*/ @endphp {{ config('app.name', 'Eaterli') }} @include('layouts.include.react-app')
@yield('content')
@yield('script')