title: How do I redirect back to a specific show View after submitting a form? (Laravel)
body: <p>I'm using Laravel to create an online teaching system, I have a rudimentary CRUD system that allows me to create degree paths. When I click on a degree path I'm taken to degrees/{{ degree->id }} and from there I can create modules. When I submit my form however, I don't know how to redirect back to that specific view. I can redirect back to the index page, then access the view and see that the module has been added, but I don't know how to go straight to the degree view. </p>
  
  <p>I'm aware you can manually input the ID, but then what if I wanted to create a module for another degree?</p>
  
  <p>Anyway, here's the store function, where my data is submitted to : </p>
  
  <pre><code>public function store(Request $request)
  {
  
    $module = new Module;
    $module-&gt;title = $request-&gt;input('title');
    $module-&gt;description = $request-&gt;input('description');
  
    $module-&gt;save();
  
    return redirect('/degrees');
  </code></pre>
  
  <p>The issue is in the redirect, I need to know how that can transfer me to the route (degrees/{{ degree->id }}), but if I type that out it doesn't understand what ID I actually want and throws an error.</p>
  
  <p>Any advice is welcome, the functionality works, I can see the modules displayed on the degree page just need to know how to get there after submitting the data.</p>
  
  <p>I'm relatively new to web-dev, so if I need to re-do things feel free to tell me I'm probably compounding errors at this point.</p>