'Laravel upgrade broke model paths

I've performed a long-overdue update on a Laravel project from v5.7 to v9 and ran into a Target class does not exist error. I found this guide and used the first method to resolve the error (adding the namespace into the RoutesServiceProvider.php boot function). This resolved that error but now, everything is giving me Class "App\Whatever" not found.

I did notice that models are now stored in a Models directory within the app directory rather than directly in app, so have moved them to Models. I figured that might be breaking my use App\Whatever; lines at the top of my controllers, so I've tried use App\Models\Whatever and also use app\Models\Whatever (since the "a" is lowercase in the directory name) but no effect.

I should note I don't really have a good grasp of namespaces, MVC frameworks etc. so ELI5 etc :-)

Some of my controller:

<?php
namespace App\Http\Controllers;

use Illuminate\Http\Request;

use App\Thing;
use App\AnotherThing;
...
    public function thing_summary($id) // show the summary view of the thing

    {

        if(Auth::check()) {

            $thing = Thing::find($id);
...


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source