title: Too few arguments to function App\Http\Controllers\ProjectController::index(), 0 passed in C:\xampp\htdocs\ContentBaseApp\
body: <p>I have error:</p>
  <blockquote>
  <p>ArgumentCountError Too few arguments to function
  App\Http\Controllers\ProjectController::index(), 0 passed in
  C:\xampp\htdocs\ContentBaseApp\vendor\laravel\framework\src\Illuminate\Routing\Controller.php
  on line 54 and exactly 1 expected</p>
  </blockquote>
  <p><a href="https://i.stack.imgur.com/W9xPw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/W9xPw.png" alt="enter image description here" /></a></p>
  <p>In my <code>ProjectController.php</code> How can i solve this
  This is my <code>ProjectController.php</code></p>
  <pre><code>public function index($product_id)
  {
      // $projects = Project::whereIn('product_id',Product::where('user_id',Auth::id())-&gt;pluck('id')-&gt;toArray())-&gt;latest()-&gt;paginate(20);
  
      $product = Product::where('user_id', Auth::id())-&gt;where('id', $product_id)-&gt;firstOrFail();
      $projects = Project::where('product_id', $product-&gt;id)-&gt;latest()-&gt;paginate(20);
  
      return view('projects.index', compact('projects'))
              -&gt;with('i', (request()-&gt;input('page', 1) - 1) * 5);
  }
  </code></pre>
  <p><a href="https://i.stack.imgur.com/PYxI7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PYxI7.png" alt="" /></a></p>
  <p>I wrote index method code because I want; suppose I have two id <code>1</code> &amp; <code>2</code> if I click id <code>1</code> it will take me to <code>index.blade.php</code> where I can upload new data like <code>data_1</code> and <code>data_2</code> those data will show on index.blade.php</p>
  <p>And if I click id <code>2</code> it will take me to <code>index.blade.php</code> where I don't want to see data of id <code>1</code> as I uploaded data1 and data2.</p>
  <p>If I upload new data for id <code>2</code> I can see those data in <code>index.blde.php</code></p>