title: Laravel - Passing parameter for patch request
body: <p>Hi i am working on a update method for updating a profile, right now i am updating the profile by passing the model as a parameter but i am wanting to pass in the id of a profile so the route is <code>patch('/profiles/podcast/{id}''</code> i am quite new to laravel so im wondering how do i modify the controller and phpunit test to update this way when grabbing objects in laravel?</p>
  
  <p>Update function in the controller:</p>
  
  <pre><code> public function update(PodcastProfile $podcastProfile)
  {
      $this-&gt;user = Auth::user();
      $this-&gt;podcastProfile = $podcastProfile;
  
      if (!$this-&gt;hasPodcastProfile()) {
          abort(400, "You don't have a podcast profile configured");
      }
  
      $this-&gt;validation();
  
      $this-&gt;transaction();
  
      return $this-&gt;podcastProfile-&gt;toJson();
  }
  </code></pre>
  
  <p>This is the current route for the update method</p>
  
  <pre><code>Route::patch('/profiles/podcast/{podcastProfile}', 'PodcastProfileController@update');
  </code></pre>
  
  <p>This is the phpunit test case for the function</p>
  
  <pre><code> /**
   * @test
   */
  public function it_should_update_podcast_profile()
  {
      $podcastDetails = $this-&gt;handlePostRequestToController();
  
      $this-&gt;json('patch', '/profiles/podcast/' . $podcastDetails['id'], $this-&gt;updateData)
          -&gt;assertSuccessful();
  
      $this-&gt;checkPodcastProfile($this-&gt;updateData, $podcastDetails['id']);
      $this-&gt;checkGuestFormats($this-&gt;updateData['guest_format']);
      $this-&gt;checkAvailability($this-&gt;updateData['availability']);
      $this-&gt;checkEquipment($this-&gt;updateData['equipment']);
      $this-&gt;checkCategories($this-&gt;updateData['categories']);
      $this-&gt;checkLocation($this-&gt;updateData['country'], $this-&gt;updateData['city']);
  }
  </code></pre>