title: Laravel controller trigger modal to show data
body: <p>So I have this code where originally if I press the button it will open a page showing detail about items, but I want it just to show it in modal. is that any possible?</p>
  <p>my index inside controller</p>
  <pre class="lang-php prettyprint-override"><code>public function index(SubOrder $order)
  {
      Paginator::useBootstrap();
      
      $items = $order-&gt;items;
      $tokoId = Toko::select('id')-&gt;firstWhere('user_id', auth()-&gt;id())-&gt;id;
      $orders = SubOrder::where('toko_id', $tokoId)-&gt;orderBy('created_at', 'desc')-&gt;get();
      
      return view('sellers.order.backup', compact('items','orders'));
  }
  </code></pre>
  <p>the show function inside the same controller</p>
  <pre class="lang-php prettyprint-override"><code>public function show(SubOrder $order)
  {
      $items = $order-&gt;items;
      
      return view('sellers.order.show', compact('items'));
  }
  </code></pre>
  <p>the index blade</p>
  <pre class="lang-xml prettyprint-override"><code>&lt;table class=&quot;table table-striped&quot;&gt;
    &lt;thead class=&quot;thead-dark&quot;&gt;
      &lt;tr&gt;
        &lt;th&gt;Create&lt;/th&gt;
        &lt;th&gt;Detail&lt;/th&gt;
      &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;
      @forelse ($orders as $subOrder)
        &lt;tr&gt;
          &lt;td&gt;{{$subOrder-&gt;created_at}}&lt;/td&gt;
          &lt;td&gt;
            &lt;a name=&quot;&quot; id=&quot;&quot; class=&quot;btn btn-warning btn-sm&quot; href=&quot;{{route('seller.orders.show', $subOrder)}}&quot; role=&quot;button&quot;&gt;Detail Pesanan&lt;/a&gt;
          &lt;/td&gt;
        &lt;/tr&gt;
      @empty
      @endforelse
    &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>
  <p>while the show blade is</p>
  <pre class="lang-xml prettyprint-override"><code>&lt;table class=&quot;table table-striped&quot; style=&quot;padding-bottom: 50px&quot;&gt;
    &lt;thead class=&quot;thead-dark&quot;&gt;
      &lt;tr&gt;
        &lt;th&gt;Nama Barang&lt;/th&gt;
        &lt;th&gt;Jumlah&lt;/th&gt;
        &lt;th&gt;Harga&lt;/th&gt;
      &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;
      @foreach ($items as $item)
        &lt;tr&gt;
          &lt;td scope=&quot;row&quot;&gt;{{$item-&gt;nama}}&lt;/td&gt;
          &lt;td&gt;{{$item-&gt;pivot-&gt;jumlah}}&lt;/td&gt;
          &lt;td&gt;@currency($item-&gt;pivot-&gt;harga)&lt;/td&gt;
        &lt;/tr&gt;
      @endforeach
    &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>
  <p>this code works fine, but I want it just show the detail in the modal. tried it before where I just copy paste the show blade code to the modal body and not working. help</p>