title: Laravel submit form from a tab and return to same tab in view
body: <p>I have a view with multiple tabs. Each having different forms. When I submit a form from one tab, it returns to same page but primary tab. How could I get to return to same tab from which I was working. </p>
  
  <p><strong>Controller</strong></p>
  
  <pre><code>public function recieve(Request $request)
      {        
          $item = Item::find($request-&gt;input('item'));
              $item-&gt;recieved_at = now();
              $item-&gt;recieved_status = "1";
              $item -&gt; save();
          return redirect('/files/'.$item-&gt;file)-&gt;with('success','Item Recieved Confirmed');
      }
  </code></pre>
  
  <p><strong>view</strong> - tabs </p>
  
  <pre><code>&lt;ul class="nav nav-tabs" id="fileTab" role="tablist"&gt;
              &lt;li class="nav-item"&gt;
                  &lt;a class="nav-link active" id="profile-tab" data-toggle="tab" href="#profile" role="tab"
                     aria-controls="profile" aria-selected="true"&gt;Profile&lt;/a&gt;
              &lt;/li&gt;
              &lt;li class="nav-item"&gt;
                  &lt;a class="nav-link" id="job-tab" data-toggle="tab" href="#job" role="tab" aria-controls="job"
                     aria-selected="false"&gt;Job&lt;/a&gt;
              &lt;/li&gt;
              &lt;li class="nav-item"&gt;
                  &lt;a class="nav-link" id="items-tab" data-toggle="tab" href="#items" role="tab" aria-controls="items"
                     aria-selected="false"&gt;Items&lt;/a&gt;
              &lt;/li&gt;
              &lt;li class="nav-item"&gt;&lt;a class="nav-link" id="mechanic-tab" data-toggle="tab" href="#mechanic" role="tab"
                                      aria-controls="mechanic" aria-selected="false"&gt;Labour Hours&lt;/a&gt;
              &lt;/li&gt;
              &lt;li class="nav-item"&gt;
                  &lt;a class="nav-link" id="accounts-tab" data-toggle="tab" href="#accounts" role="tab"
                     aria-controls="accounts" aria-selected="false"&gt;Accounts&lt;/a&gt;
              &lt;/li&gt;
              &lt;li class="nav-item"&gt;
                  &lt;a class="nav-link" id="accounts-tab" data-toggle="tab" href="#preview" role="tab"
                     aria-controls="accounts" aria-selected="false"&gt;Print Preview&lt;/a&gt;
              &lt;/li&gt;
          &lt;/ul&gt;
  </code></pre>
  
  <p>Form</p>
  
  <pre><code>@if($file-&gt;job_status == "Closed")@else 
  {!! Form::open(['action' =&gt; 'FilesController@item','method' =&gt; 'POST']) !!}
  &lt;div class="row pt-3 pb-1"&gt;
      &lt;div class="form-group col-xs-12 col-sm-12 col-md-2"&gt;
          {{Form::text('part_number','',['class'=&gt;'form-control','placeholder'=&gt;'Part Number'])}}
      &lt;/div&gt;
      &lt;div class="form-group col-xs-12 col-sm-12 col-md-6"&gt;
          {{Form::text('description','',['class'=&gt;'form-control','placeholder'=&gt;'Part Name'])}}                   
      &lt;/div&gt;
      &lt;div class="form-group col-xs-12 col-sm-12 col-md-2"&gt;
          {{Form::text('qty','',['class'=&gt;'form-control','placeholder'=&gt;'Qty'])}}                 
      &lt;/div&gt;
      &lt;div class="form-group col-xs-12 col-sm-12 col-md-2"&gt;
          {{Form::select('recieved_by',$users,null,['class'=&gt;'form-control'])}}                   
      &lt;/div&gt;
  &lt;/div&gt;
      {{Form::hidden('file',$file-&gt;id)}}
      {{Form::submit('Release Item',['class'=&gt;'form-control btn-danger btn btn-sm'])}}
  {!! Form::close() !!}
  @endif
  </code></pre>
  
  <p>I tried using hashtag tab name in return redirect statement,</p>
  
  <pre><code>return redirect('/files/'.$item-&gt;file."#items-tab")-&gt;with('success','Item Recieved Confirmed');
  </code></pre>
  
  <p>it would simply highlight the name but would not select. How could I achieve it?</p>
  
  <p><a href="https://i.stack.imgur.com/Z7Nyk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Z7Nyk.png" alt="enter image description here"></a></p>