title: Update related data Laravel 5
body: <p>I have this method update to update a data (jurnal data) that belongs to another data (edisi data), below is the code :</p>
  
  <pre><code>public function update(Jurnal $jurnal, JurnalRequest $request) {
          $input = $request-&gt;all();
          if ($request-&gt;hasFile('file') &amp;&amp; $request-&gt;file('file')-&gt;isValid()) {
              // Delete old file
              $this-&gt;hapusPDF($jurnal);
  
              // Upload new file
              $input['file'] = $this-&gt;uploadPDF($request);
          }
          $id = $request-&gt;id; //retrieve id edisi
  
          $jurnal = Edisi::findOrFail($id)-&gt;jurnal()-&gt;update($input);
          return redirect()-&gt;route('edisi', ['id' =&gt; $id]);
      }
  </code></pre>
  
  <p>The method above gave me this error : No query results for model [App\Edisi]. My question is how to make my update method working ? Thank you ..</p>