in Class ‘App\Http\Controllers\Auth’ not found Resolve Error for Go to YourCustomController after that add use Auth; at the top on the Controller Page.
Display Error: Class ‘App\Http\Controllers\Auth’ not found -FatalErrorException in LoginController.php
FatalErrorException in LoginController.php line 52: Class ‘App\Http\Controllers\Admin\Auth\Auth’ not found in LoginController.php line 52
Solution for “Class ‘App\Http\Controllers\Auth’ not found”
Contents
use Auth; // Illuminate\Support\Facades\Auth //or try it use Illuminate\Support\Facades\Auth;
Also Read: Html Form Class Not Found In Laravel
‘App\Http\Controllers\Auth\Auth’ not found in Laravel 5.6
step 1: first of all go to Illuminate\Foundation\Exceptions\Handler.php class
step 2: here find unauthenticated method
step 3: and then last update it with source code below
protected function unauthenticated($request, AuthenticationException $exception) { return $request->expectsJson() ? response()->json(['message' => $exception->getMessage()], 401) : redirect('/'); }
The proper namespace is Illuminate\Support\Facades\Auth;
also you can Add use Illuminate\Support\Facades\Auth; at the top part of your controller class in Laravel. also you can read my prev post like as class ‘collective\html\htmlserviceprovider’ not found
You must use the Auth facade. Add this line to top part of your Laravel controller: resolve this error : Class ‘App\Http\Controllers\Auth’ not found
I hope you get an idea about class ‘auth’ not found.
I would like to have feedback on my infinityknow.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.
I am Jaydeep Gondaliya , a software engineer, the founder and the person running Pakainfo. I’m a full-stack developer, entrepreneur and owner of Pakainfo.com. I live in India and I love to write tutorials and tips that can help to other artisan, a Passionate Blogger, who love to share the informative content on PHP, JavaScript, jQuery, Laravel, CodeIgniter, VueJS, AngularJS and Bootstrap from the early stage.