title: Laravel 9 - Error "index was not found. Are you sure the view exists and is a .blade.php file?"
body: <p><em>I'm new and not so familiar with the posting etiquette, please forgive me if I break any conventions or rules.</em></p>
  <p>To summarise my problem, I am receiving an error in Laravel 9 in which it says &quot;are you sure the view exists and is a .blade php file?&quot;.</p>
  <p>I'm following a tutorial from <strong>2019</strong> so I can only assume there have been changes since then which have left me with the error, especially as I've followed the course exactly.</p>
  <p>I've searched on google and stackoverflow for answers but they all seem to be for previous versions of Laravel, and honestly I don't even really understand the explanations given.</p>
  <p>My end goal is to have localhost:8000/profile/{username} and &quot;&quot;/p/{username} present the index.blade.view, however it says it cannot be found because the ProfilesController can't be located.</p>
  <p>At this point I'm pretty confused so I'll post the relevant code snippets (let me know if more is needed) and hopefully I can make some progress here :) Thank-you in advance!</p>
  <p><a href="https://i.stack.imgur.com/bLSPR.png" rel="nofollow noreferrer">Directory structure</a></p>
  <p><strong>web.php</strong></p>
  <pre><code>&lt;?php
  
  use Illuminate\Support\Facades\Route;
  
  
  Route::get('/', function () {
      return view('welcome');
  });
  
  Auth::routes();
  
  Route::get('/p/create', 'PostsController@create');
  
  Route::get('/profile/{user}', [App\Http\Controllers\ProfilesController::class,'index'])-&gt;name('profile.show');
  </code></pre>
  <p><strong>Profiles Controller</strong></p>
  <pre><code>&lt;?php
  
  namespace App\Http\Controllers;
  
  
  use Illuminate\Http\Request;
  use App\Models\User;
  
  class ProfilesController extends Controller
  {
      public function index($user)
      {
  
      $user = User::findOrFail($user);
  
      return view('index',['user' =&gt; $user
      ]);
  }
  }
  </code></pre>
  <p>Thanks guys and gals!</p>