@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; $restaurant = session('restaurant'); $location_id = $restaurant['location_id'] ?? NULL; $restaurant_id = $restaurant['restaurant_id'] ?? NULL; @endphp @endhasrole @hasanyrole('BranchOwner|BranchManager|BranchStaffMember') @php $location = auth()->user()->getLocationUserData(); // $location_id = $location->id; // $restaurant_id = $location->restaurant_id; $restaurant = session('restaurant'); $location_id = $restaurant['location_id'] ?? NULL; $restaurant_id = $restaurant['restaurant_id'] ?? NULL; @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