title: How to handle two parameters in laravel when passing from a route to a page
body: <p>I'm passing the below two routes</p>
  
  <pre><code>Route::get('library/course/{id}', function($id){
      return View::make('course')-&gt;with('id',$id);
  });
  
  Route::get('library/course/{id}/{video}', function($id, $video){
      $array = array('id' =&gt; '$id', 'video' =&gt; '$video');
      return View::make('course')-&gt;withvideos($array);
  });
  </code></pre>
  
  <p>Both the routes are working properly but just one by one to the course.blade.php page. If i remove the content of first route then the 2nd route works otherwise it gives me an error. How can i handle these both routes on the page?</p>
  
  <p>******UPDATED</p>
  
  <p>The code of my course page is the following.
  Note only I'm using the first route in this page. I'm unable to use the second as it gives an error.</p>
  
  <pre><code>@extends('layouts.master')
  
  @section('content')
  
  
  
      &lt;div class="row" style="margin-top: 5%;"&gt;
          &lt;div class="large-4 columns"&gt;
              &lt;?php $coursesName = DB::table('topics')-&gt;select('title')-&gt;get(); ?&gt;
              &lt;ul class="side-nav"&gt;
                  @foreach($coursesName as $courseName)
                  &lt;li&gt;&lt;a href="#"&gt;{{ $courseName-&gt;title }}&lt;/a&gt;&lt;/li&gt;
                  @endforeach
              &lt;/ul&gt;
          &lt;/div&gt;
          &lt;div class="large-8 columns" data-equilizer&gt;
              &lt;?php $courseViews = DB::table('courses')-&gt;whereid($id)-&gt;get();  ?&gt;
  
              @foreach($courseViews as $courseView)
  
                  &lt;?php $requiredId = $courseView-&gt;id; ?&gt;
  
                  &lt;?php  $courseVideos = DB::table('videos')-&gt;whereid($requiredId)-&gt;get(); ?&gt;
  
                  @foreach($courseVideos as $courseVideo)
                      &lt;!--&lt;iframe src="https://player.vimeo.com/video/{{ $courseVideo-&gt;link }}?color=ff9933&amp;title=0&amp;byline=0&amp;portrait=0' width='700' height='400' frameborder='0' webkitallowfullscreen mozallowfullscreen allowfullscreen"&gt;&lt;/iframe&gt;--&gt;
                      &lt;br&gt;
                      &lt;a href="{{ $courseView-&gt;id }}/{{ $courseVideo-&gt;id }}"&gt;{{ $courseVideo-&gt;name }}&lt;/a&gt;
                  @endforeach
  
              @endforeach
  
  
          &lt;/div&gt;
  
  
  
      &lt;/div&gt;
  @stop
  </code></pre>