title: Laravel polymorphic relations: Passing model to controller
body: <p>I want to use a single controller to save my comments for multiple models. So I created the CommentController, with the following store method:</p>
  
  <pre><code>public function store(Teacher $teacher, Request $request)
      {    
          $input = $request-&gt;all();
  
          $comment = new Comment();
  
          $comment-&gt;user_id = Auth::user()-&gt;id;
          $comment-&gt;body = $input['body'];
  
          $teacher-&gt;comments()-&gt;save($comment);
  
          return redirect()-&gt;back();
      }
  </code></pre>
  
  <p>In my view, I have: </p>
  
  <pre><code>{!! Form::open([
      'route' =&gt; ['teachers.comments.store', $teacher-&gt;id]
  ]) !!}
  </code></pre>
  
  <p>This is working. If I want to use the same CommentController to store the comments for a school, how should I modify the store method of the controller? </p>