How to fix Class ‘App\Http\Controllers\Auth’ not found

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”

use Auth; 
// Illuminate\Support\Facades\Auth

//or try it

use Illuminate\Support\Facades\Auth;

Also Read: Html Form Class Not Found In Laravel

Read Also:  Task Scheduling with Cron Job using Laravel 5/6/7

‘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

Read Also:  Converting JSON Object into Javascript PHP array

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 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.

Read Also:  Remove Empty File Data with PHP

Related FAQ

Here are some more FAQ related to this Article:

  1. Read Also:  Sum all properties value in object Using Vuejs
  2. Read Also:  how to insert data from one database table to another database table in mysql?
  3. Read Also:  SQL multiple joins for beginners with examples
  4. Read Also:  Angular 9/8 Material Checkbox Examples
  5. Read Also:  URL Redirect in Laravel Tutorial
  6. Read Also:  Advanced jQuery Tips Tricks and Solutions
  7. Read Also:  Pattern programs in GO Example
  8. Read Also:  php include file from another folder
  9. Read Also:  php include file from another folder
  10. Read Also:  Pattern programs in GO Example