title: Calling custom class method with a parameter in laravel route
body: <p>So I have this function that is going to be used 1 as an artisan command or 2 as a link a user can use.</p>
  
  <p>Here's the function: </p>
  
  <pre><code>public function saveAll($whatLocation)
      {
        $userSaved = $this-&gt;saveUsersData();
        $componentSaved = $this-&gt;saveComponentsData();
        $issueSaved = $this-&gt;saveIssuesData();
        $timelogSaved = $this-&gt;saveTimelogsData();
        if($userSaved === 1 &amp;&amp; $componentSaved === 1 &amp;&amp; $timelogSaved === 1)
        {
          $this-&gt;allSaved = 1;
        }
        if($whatLocation != "artisanCommand")
        {
          return redirect()-&gt;back();
        }
        else
        {
          return $this-&gt;allSaved;
        }
  
      }
  </code></pre>
  
  <p>The idea is that if it's coming from an artisan console command I created I pass "artisanCommand" but if it's coming from a route it pulls my api data and re-directs to the previous page.</p>
  
  <p>Here's the problem: </p>
  
  <p>in the web routes file I now can't call a function that has a parmater?</p>
  
  <pre><code>Route::get('/pull-and-save-api-data', [App\Classes\SaveApiData::class, 'saveAll'])-&gt;name('pull-and-save-api-data');
  </code></pre>
  
  <p>This works if there's no paramater on the function,  but will not work now that there's a parameter??</p>
  
  <p>I've tried:</p>
  
  <pre><code>Route::get('/pull-and-save-api-data', [App\Classes\SaveApiData::class, 'saveAll("notcommand")'])-&gt;name('pull-and-save-api-data');
  
  Route::get('/pull-and-save-api-data/{notcommand}', [App\Classes\SaveApiData::class, 'saveAll'])-&gt;name('pull-and-save-api-data');
  </code></pre>
  
  <p>neither work?  </p>