There are a few different ways to make Laravel work on our hosting, i.e. work around the limitation of not being able to change the document root of your website.
My personal preference is to leave the Laravel installation as-is, and instead use .htaccess rules to reroute the website base directory to the public directory like so:
This is not the only method, but this is the method I recommend. I have no idea if that approach from ChatGPT works.
That said, usually what people want is to get rid of the public part in the URL, which at least your current code clearly doesn’t seem to be doing.
This error suggests a different issue entirely. Specifically, this implies that the ViewServiceProvider is missing, which is not a .htaccess issue.
This is strange though because Laravel should do this out of the box. So I’m not sure why this is happening, other than that it’s probably an issue with how your site is set up.