title: Redirect back to same page (with variables) on form submit in Laravel 5
body: <p>On my page events.index, I first display a list of events for the logged on user.</p>
  
  <p>On my index page I have a form with option/select to let the user select and display the events of another user. When he submits that form, I would like my index function (controller) to use the $user_id value (from the form) and display the events.index page again, but for events of that selected user.</p>
  
  <p>I'm not sure what would be the best approach:</p>
  
  <ul>
  <li>Set a session variable to keep the user_id value? Not sure how to do that with a form.</li>
  <li>Submit the form with a get method (and get an ugly ?user_id=1 URL)</li>
  <li>Change my index route to accept the post method (although I already have that post/events route taken (by Route::post('events', 'EventsController@store'))</li>
  </ul>
  
  <p>Not sure what would be a clean way to do this:</p>
  
  <p>My route for events/index: </p>
  
  <pre><code>Route::get('events', [
  'as' =&gt; 'event.index',
  'uses' =&gt; 'EventsController@index'
  ]);
  </code></pre>
  
  <p>Events Controller   </p>
  
  <pre><code>public function index()
  {
      // How to get the $user_id value from form?
  
      if (empty($user_id)) 
      {
          $user_id = \Auth::user()-&gt;id;
      }
  
      $events = Event::where('events.user_id','=','$user_id');        
      $users  = User::all();
  
      return view('events.index')-&gt;with(['events' =&gt; $events])-&gt;with(['users' =&gt; $users]);
  }
  </code></pre>
  
  <p>View for index</p>
  
  <pre><code>{!! Form::open(['route' =&gt; 'events.index', 'method' =&gt; 'get']) !!}
  
      &lt;select id="user_id" name="user_id"&gt;
      @foreach($users as $user)
          &lt;option value="{{$user-&gt;id}}"&gt;{{$user-&gt;name}}&lt;/option&gt;
      @endforeach
      &lt;/select&gt;
  
  {!! Form::submit('Show events for this user') !!}
  
  {!! Form::close() !!}   
  
  
  @foreach($events as $event)
       ...
  @endforeach
  </code></pre>