title: Error “Target class controller does not exist” when using Laravel 8
body: <p><strong>Here is my controller:</strong></p>
  <pre><code>&lt;?php
  
  namespace App\Http\Controllers\Api;
  
  use App\Http\Controllers\Controller;
  use Illuminate\Http\Request;
  
  class RegisterController extends Controller
  {
      public function register(Request $request)
      {
          dd('aa');
      }
  }
  </code></pre>
  <p>As seen in the screenshot, the class exists and is in the correct place:</p>
  <p><a href="https://i.stack.imgur.com/H4CtY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/H4CtY.png" alt="Enter image description here" /></a></p>
  <p><strong>My <code>api.php</code> route:</strong></p>
  <pre><code>Route::get('register', 'Api\RegisterController@register');
  </code></pre>
  <p>When I hit my <code>register</code> route using <a href="https://stackoverflow.com/tags/postman/info">Postman</a>, it gave me the following error:</p>
  <blockquote>
  <p>Target class [Api\RegisterController] does not exist.</p>
  </blockquote>
  <p>How can I fix it?</p>
  <hr />
  <p>Thanks to the answers, I was able to fix it. I decided to use the fully qualified class name for this route, but there are other options as described in the answers.</p>
  <pre><code>Route::get('register', 'App\Http\Controllers\Api\RegisterController@register');
  </code></pre>