My Laravel-5.8 application was working, but suddenly I got this error:
production.ERROR: Class AppHttpMiddlewareSetLocale does not exist
and can't login again.
The SetLocale exists. This is it:
namespace AppHttpMiddleware; use Closure; class SetLocale { public function handle($request, Closure $next) { if (request('change_language')) { session()->put('language', request('change_language')); $language = request('change_language'); } elseif (session('language')) { $language = session('language'); } elseif (config('panel.primary_language')) { $language = config('panel.primary_language'); } if (isset($language)) { app()->setLocale($language); } return $next($request); } }
How do I resolve it?
Thanks
Namespace seems correct and only thing I can think of is composer cache.
Try to run command composer dumpautoload at your project root directory to force the autoload file to regenerate.
composer dumpautoload
1.4m articles
1.4m replys
5 comments
57.0k users