title: Redirect with compact value in laravel
body: <p>Route :</p>
  
  <pre><code>Route::get('merchantTrans/{id}','MerchantController@merchant');
  </code></pre>
  
  <p>Merchant Controller :</p>
  
  <pre><code>public function merchant($id){
      $merchant = Merchant::whereId($id)-&gt;get();
      return redirect('Merchant view')-&gt;with(compact('merchant'));
  }
  </code></pre>
  
  <p>View Route :</p>
  
  <pre><code>Route::view('Merchant view','merchant.listview')-&gt;name('Merchant view');
  </code></pre>
  
  <p>I cannot pass merchant compact value to view. </p>
  
  <p>Produce error</p>
  
  <h3>Undefined variable: merchant</h3>
  
  <p>Any other best way?</p>