title: How to redirect one category to sub category?
body: <p>This is FrontController</p>
  
  <pre><code>public function index(){
      $categories = DB::table('categories')
          -&gt;select('category')
          -&gt;groupBy('category')
          -&gt;get();
      return view('front', compact('categories'));
  }
  </code></pre>
  
  <p>This is blade layout</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>@foreach($categories as $category)
  &lt;a href=""&gt;&lt;h2 class="card-title"&gt;{{$category-&gt;category}}&lt;/br&gt;&lt;/h2&gt;&lt;/a&gt;
  @endforeach</code></pre>
  </div>
  </div>
  </p>
  
  <p><a href="https://i.stack.imgur.com/pRHeZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pRHeZ.png" alt="Categories-table structure and data"></a></p>
  
  <p><a href="https://i.stack.imgur.com/f47uf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/f47uf.png" alt="This is my front page"></a></p>
  
  <p>My question is when i click any category redirect to related to subcategory...How can i do that??</p>