简体   繁体   English

找不到Symfony \\ Component \\ Debug \\ Exception \\ FatalThrowableError类'\\ App \\ Admin'

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

I am using laravel-5.7. 我正在使用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

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. 您的app目录中没有名为Admin的类,或者在类顶部没有namespace

<?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 {}

Suppose you have Model class called Admin in the App folder, then you are calling it somewhere in the controller. 假设您在App文件夹中有一个名为Admin的Model类,然后在控制器中的某个位置调用它。

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
}

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 所以先检查两个

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Symfony \ Component \ Debug \ Exception \ FatalThrowableError类'Buno \ Readr \ ReadrServiceProvider'未找到 - Symfony\Component\Debug\Exception\FatalThrowableError Class 'Buno\Readr\ReadrServiceProvider' not found 找不到Laravel Forge返回[Symfony \\ Component \\ Debug \\ Exception \\ FatalThrowableError]类 - Laravel Forge returning [Symfony\Component\Debug\Exception\FatalThrowableError] class not found Symfony \\ Component \\ Debug \\ Exception \\ FatalThrowableError(E_ERROR)类&#39;APP \\ Mail \\ Reverify&#39;未找到 - Symfony \ Component \ Debug \ Exception \ FatalThrowableError (E_ERROR) Class 'APP\Mail\Reverify' not found Laravel 5.6 Symfony \\ Component \\ Debug \\ Exception \\ FatalThrowableError (E_ERROR) Class &#39;\\App\\Utilisateurs&#39; 未找到 - Laravel 5.6 Symfony \ Component \ Debug \ Exception \ FatalThrowableError (E_ERROR) Class '\App\Utilisateurs' not found “Symfony\\Component\\Debug\\Exception\\FatalThrowableError” - The "Symfony\Component\Debug\Exception\FatalThrowableError" 在 Laravel 上找不到类 - Symfony \\ Component \\ Debug \\ Exception \\ FatalThrowableError (E_ERROR) - Class not found on Laravel - Symfony \ Component \ Debug \ Exception \ FatalThrowableError (E_ERROR) Symfony \\ Component \\ Debug \\ Exception \\ FatalThrowableError(E_ERROR)找不到类“购物车” - Symfony\Component\Debug\Exception\FatalThrowableError (E_ERROR) Class 'Cart' not found 未捕获的 Symfony\Component\Debug\Exception\FatalThrowableError: - Uncaught Symfony\Component\Debug\Exception\FatalThrowableError: Symfony \ Component \ Debug \ Exception \ FatalThrowableError (E_ERROR) 调用未定义的 function App\needsRehash() - Symfony \ Component \ Debug \ Exception \ FatalThrowableError (E_ERROR) Call to undefined function App\needsRehash() Symfony\Component\Debug\Exception\FatalThrowableError:语法错误,文件意外结束 - Symfony\Component\Debug\Exception\FatalThrowableError : syntax error, unexpected end of file
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM