title: access the edit function inside my controller
body: <p>Hi guys new to laravel here. I am trying to edit my post and when i try to access the <code>edit</code> function in my controller i get this <code>error Property [id] does not exist on this collection instance.</code></p>
  
  <blockquote>
    <p>This is My route code </p>
  </blockquote>
  
  <pre><code>Route::resource('/article','PostController'); 
  </code></pre>
  
  <blockquote>
    <p>This is my Controller </p>
  </blockquote>
  
  <pre><code>public function edit(Post $post)
  {
  
      $post = Post::all();
      return view('article.edit',compact('post'));
  
  }
  </code></pre>
  
  <blockquote>
    <p>This is my View code </p>
  </blockquote>
  
  <pre><code>&lt;a href="{{route('article.edit', $post-&gt;id)}}" class="btn btn-info btn-sm btn-bordred wave-light"&gt; 
  &lt;i class="fas fa-edit"&gt;&lt;/i&gt;&lt;/a&gt;
  </code></pre>
  
  <blockquote>
    <p>And solution ? Thanks in advance</p>
  </blockquote>