Class ‘app\http\controllers\Redirect, Auth, Session Not Found

Class ‘app\http\controllers\Redirect, Auth, Session Not Found

Class ‘app\http\controllers\ Not Found

In this tutorial, we will provide you solutions of the following exceptions:

  • Class ‘App\Http\Controllers\Redirect’ not found
  • Class ‘App\Http\Controllers\Validator’ not found
  • Class ‘App\Http\Controllers\Session’ not found
  • Class ‘App\Http\Controllers\Auth’ not found
  • Class ‘App\Http\Controllers\Input’ not found
  • Class ‘App\Http\Controllers\Response’ not found
  • Class ‘App\Http\Controllers\Model’ not found
  • Class ‘App\Http\Controllers\View’ not found
  • Class ‘App\Http\Controllers\DB’ not found

You can use this Class ‘App\Http\Controllers\’ not found solutions with Laravel 7,6,5, 4 version on Controller.

1: Class ‘App\Http\Controllers\Redirect’ not found

If you are getting error like Class ‘App\Http\Controllers\Redirect’ not found on controller in laravel.

So, add use Redirect; at the top of YourController file along with other prefix:

use Redirect;

On YourController.php file, add use Redirect; at the top of YourController file like following:

namespace App\Http\Controllers;

use Illuminate\Http\Request;

use Redirect;

class YourController extends Controller
{
    public function index(Request $request)
    {
        //your code
    }

}

2: Class ‘App\Http\Controllers\Validator’ not found

If you are getting error like Class ‘App\Http\Controllers\Validator’ not found on controller in laravel.

So, add use Validator; at the top of YourController file:

use Validator;

On YourController.php file, add use Validator; at the top of YourController file like the following:

namespace App\Http\Controllers;

use Illuminate\Http\Request;

use Validator;

class YourController extends Controller
{
    public function index(Request $request)
    {
        //your code
    }

}

3: Class ‘App\Http\Controllers\Session’ not found

If you are getting error like Class ‘App\Http\Controllers\Session’ not found on controller in laravel.

So, add use Session; at the top of YourController file along with other prefix:

use Session;

OR

use Illuminate\Support\Facades\Session;

On YourController.php file, add use Session; at the top of YourController a file like the following:

namespace App\Http\Controllers;

use Illuminate\Http\Request;

use Session;

class YourController extends Controller
{
    public function index(Request $request)
    {
        //your code
    }

}

4: Class ‘App\Http\Controllers\Auth’ not found

If you are getting error like Class ‘App\Http\Controllers\Auth’ not found on controller in laravel.

So, add use Auth; at the top of YourController file along with other prefix:

use Auth;

OR

Illuminate\Support\Facades\Auth;

On YourController.php file, add use Auth; at the top of YourController file like following:

namespace App\Http\Controllers;

use Illuminate\Http\Request;

use Auth;

class YourController extends Controller
{
    public function index(Request $request)
    {
        //your code
    }

}

5: Class ‘App\Http\Controllers\Input’ not found

If you are getting error like Class ‘App\Http\Controllers\Input’ not found on controller in laravel.

So, add use Illuminate\Support\Facades\Input; at the top of YourController file along with other prefix:

use Illuminate\Support\Facades\Input;

On YourController.php file, add use Illuminate\Support\Facades\Input; at the top of YourController file like following:

namespace App\Http\Controllers;

use Illuminate\Http\Request;

use Illuminate\Support\Facades\Input;

class YourController extends Controller
{
    public function index(Request $request)
    {
        //your code
    }

}

6: Class ‘App\Http\Controllers\Response’ not found

If you are getting error like Class ‘App\Http\Controllers\Response’ not found on controller in laravel.

So, add use Response; at the top of YourController file along with other prefix:

use Response;

On YourController.php file, add use Response; at the top of YourController file like following:

namespace App\Http\Controllers;

use Illuminate\Http\Request;

use Response;

class YourController extends Controller
{
    public function index(Request $request)
    {
        //your code
    }

}

7: Class ‘App\Http\Controllers\Model’ not found

If you are getting error like Class ‘App\Http\Controllers\Model’ not found on controller in laravel.

So, add use App\Model; at the top of YourController file along with other prefix:

use App\ModelName;

On YourController.php file, add use Illuminate\Support\Facades\Input; at the top of YourController file like following:

namespace App\Http\Controllers;

use Illuminate\Http\Request;

use App\ModelName;

class YourController extends Controller
{
    public function index(Request $request)
    {
        //your code
    }

}

8: Class ‘App\Http\Controllers\View’ not found

If you are getting error like Class ‘App\Http\Controllers\View’ not found on controller in laravel.

So, add use View; at the top of YourController file along with other prefix:

use View;

On YourController.php file, add use View; at the top of YourController file like following:

namespace App\Http\Controllers;

use Illuminate\Http\Request;

use View;

class YourController extends Controller
{
    public function index(Request $request)
    {
        return \View::make('index');
    }

}

9: Class ‘App\Http\Controllers\DB’ not found

If you are getting error like Class ‘App\Http\Controllers\DB’ not found on controller in laravel.

So, add use DB; at the top of YourController file along with other prefix:

use DB;

On YourController.php file, add use DB; at the top of YourController file like the following:

namespace App\Http\Controllers;

use Illuminate\Http\Request;

use DB;

class YourController extends Controller
{
    public function index(Request $request)
    {
       
    }

}

AuthorAdmin

My name is Devendra Dode. I am a full-stack developer, entrepreneur, and owner of Tutsmake.com. I like writing tutorials and tips that can help other developers. I share tutorials of PHP, Javascript, JQuery, Laravel, Livewire, Codeigniter, Vue JS, Angular JS, React Js, WordPress, and Bootstrap from a starting stage. As well as demo example.

Leave a Reply

Your email address will not be published. Required fields are marked *