title: How to call method dynamically on routes on Laravel?
body: <p>I'm a newbie with this and I need some help.</p>
  
  <p>I'm developing some kind of music library and let's say I don't want to make a route for each artist so I have made this one:</p>
  
  <pre><code>Route::get('/{artist_name}', 'Artist_controller@{artist_name}');
  </code></pre>
  
  <p>I get the value of <code>{artist_name}</code> from my view and the route works, for instance, the <code>artist_name</code> may be John and the url generated is <code>localhost:8000/John</code>. But when it comes to look for the class in the controller it doesn't work. I have a class named John in my controller, but I keep getting this error when I try to access:</p>
  
  <blockquote>
    <p>BadMethodCallException
    Method [{artist_name}] does not exist.</p>
  </blockquote>
  
  <p>So I guess the route isn't taking the value of <code>{artist_name}</code>. What I intend is the route to be processed like:</p>
  
  <pre><code>Route::get('/John', 'Artist_controller@John');
  </code></pre>
  
  <p>But as I said, I don't want to create a specific route for an artist.</p>
  
  <p>I'd appreciate any kind of help. Thank You</p>