Laravel
517
Shubham Kushwah
14-08-2020
In this post, i will show you how to fix Class 'app\http\controllers\Auth Not Found, Class 'app\http\controllers\Session Not Found, Class 'app\http\controllers\DB Not Found , Class 'app\http\controllers\Model Not Found execption in laravel.
Let's start to fix the following execption in laravel.
If you found Class 'app\http\controllers\Auth Not Found, so open your controller and add following facade into your controller file in laravel:
use Illuminate\Facades\Auth ; OR use Auth;
Add this auth facade into controller as follow:
<?php namespace App\Http\Controllers; use Illuminate\Http\Request; use Auth; class TestController extends Controller { //your code }
If you found Class 'app\http\controllers\Session Not Found, so open your controller and add following facade into your controller file in laravel:
use Illuminate\Facades\Session; OR use Session;
Add this Session facade into controller as follow:
<?php namespace App\Http\Controllers; use Illuminate\Http\Request; use Session; class TestController extends Controller { //your code }
If you found Class 'app\http\controllers\DB Not Found, so open your controller and add following facade into your controller file in laravel:
use DB;
Add this DB facade into controller as follow:
<?php namespace App\Http\Controllers; use Illuminate\Http\Request; use DB; class TestController extends Controller { //your code }
If you found Class 'app\http\controllers\Model Not Found, so open your controller and add following facade into your controller file in laravel:
use App\ModelName;
Add this Model facade into controller as follow:
<?php namespace App\Http\Controllers; use Illuminate\Http\Request; use App\User; //model name class TestController extends Controller { //your code }