I have four steps. Urls of each steps are -
basic-info : localhost/project/public/user/sell/basic-info
product-info : localhost/project/public/user/sell/5/product-info
photos : localhost/project/public/user/sell/5/photos
price-info : localhost/project/public/user/sell/5/price-info
I want, when I am at basic-info then the basic-info step must have active
class and rest of the steps will have disabled
class.
And when I am at product-info then, the basic-info step will not have any class and product-info step will have active
class and rest of the steps after that will have disabled
class, and so on.
Below is the image.
Here is my code -
<div class="ui mini top four attached steps">
<div class="{{ Request::segment(3) === 'basic-info' ? 'active' : '' }} step">
<i class="info circle icon"></i>
<div class="content">
<div class="title">Basic Info</div>
<div class="description">Enter the basic information.</div>
</div>
</div>
<div class="{{ Request::segment(4) === 'product-info' ? 'active' : Request::segment(3) === 'basic-info' ? 'disabled' : '' }} step">
<i class="help circle icon"></i>
<div class="content">
<div class="title">Product Info</div>
<div class="description">Enter your product details.</div>
</div>
</div>
<div class="{{ Request::segment(4) === 'photos' ? 'active' : Request::segment(3) === 'basic-info' ? 'disabled' : Request::segment(4) === 'basic-info' ? 'disabled' : '' }} step">
<i class="image icon"></i>
<div class="content">
<div class="title">Photos</div>
<div class="description">Upload the photos of product.</div>
</div>
</div>
<div class="{{ Request::segment(4) === 'price-info' ? 'active' : Request::segment(3) === 'basic-info' ? 'disabled' : Request::segment(4) === 'basic-info' ? 'disabled' : Request::segment(4) === 'basic-info' ? 'disabled' : '' }} step">
<i class="rupee icon"></i>
<div class="content">
<div class="title">Price</div>
<div class="description">Enter the price</div>
</div>
</div>
</div>