I need to put session on the same page sidebar. when user click on any button session will get for that tab. like
- Search Job
- Customers
- etc
In the sidebar the button or not link with any page. i am creating a dialogue box for each so their is no page for the links that's why i am facing the problem. when user click any of the sidebar button the name should highlight.
DashboardController
public function disp()
{
Session::put('page', 'search-job');
Session::put('page', 'customer');
return view('front.disp');
}
layout.blade.php
@if(Session::get('page')=="search-job")
<?php $active = "active"; ?>
@else
<?php $active = ""; ?>
@endif
<li class="nav-item {{$active}}">
<a href="javascript:void(0)" class="nav-link nav-toggle">
<span class="title">SEARCH JOBS</span>
</a>
</li>
@if(Session::get('page')=="customer")
<?php $active = "active"; ?>
@else
<?php $active = ""; ?>
@endif
<li class="nav-item {{$active}}">
<a href="javascript:void(0)" class="nav-link nav-toggle">
<span class="title">Customer</span>
</a>
</li>
How to handle on this sidebar
Thanks!
as i understand from the comments you want to have different active sessions then you have 2 options like below:
put them in different indexes like this:
and in view check them like this:
put it in an array like this:
and in view check them like this: