Reputation: 31
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
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
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
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