Arbaz
Arbaz

Reputation: 31

Symfony\Component\Debug\Exception\FatalThrowableError Class '\App\Admin' not found

I am using laravel-5.7. i am making multi auth system I'm getting the following error

Symfony\Component\Debug\Exception\FatalThrowableError Class '\App\Admin' not found

Upvotes: 1

Views: 5864

Answers (3)

Udechukwu
Udechukwu

Reputation: 41

Most of the times when your class is not found, is basically as a result of not importing your namespace or typo error. so checke the two before anything else

Upvotes: 0

afikri
afikri

Reputation: 394

Suppose you have Model class called Admin in the App folder, then you are calling it somewhere in the controller.

namespace App;

use Illuminate\Database\Eloquent\Model;

class Admin extends Model
{
    //
}

Your controller will be

<?php

namespace App\Http\Controllers;
use App\Admin;
use Illuminate\Http\Request;

class YourController extends Controller
{
   //Your code goes here
}

Upvotes: 1

nakov
nakov

Reputation: 14268

The answer is in the error that you get. You either don't have a class in your app directory named Admin or you don't have the namespace on top of your class.

<?php namespace App;

class Admin 
{

}

or if your error is in a different class then you need to import it on top.

...
use PATH_TO_THE_ADMIN;

class YourClass {}

Upvotes: 0

Related Questions