缓存错误类不存在-Laravel 5.7

时间:2019-02-07 13:56:56

标签: php laravel laravel-5 artisan laravel-5.7

我无法在Laravel 5.7上列出我的路线

我尝试过Function NetDirectoryExists( const dirname: String; timeoutMSecs: Dword ): Boolean; implementation uses Classes, Sysutils, Windows; type ExceptionClass = Class Of Exception; TTestResult = (trNoDirectory, trDirectoryExists, trTimeout ); TNetDirThread = class(TThread) private FDirname: String; FErr : String; FErrclass: ExceptionClass; FResult : Boolean; protected procedure Execute; override; public Function TestForDir( const dirname: String; timeoutMSecs: Dword ):TTestResult; end; Function NetDirectoryExists( const dirname: String; timeoutMSecs: Dword ): Boolean; Var res: TTestResult; thread: TNetDirThread; Begin Assert( dirname <> '', 'NetDirectoryExists: dirname cannot be empty.' ); Assert( timeoutMSecs > 0, 'NetDirectoryExists: timeout cannot be 0.' ); thread:= TNetDirThread.Create( true ); try res:= thread.TestForDir( dirname, timeoutMSecs ); Result := res = trDirectoryExists; If res <> trTimeout Then thread.Free; {Note: if the thread timed out it will free itself when it finally terminates on its own. } except thread.free; raise end; End; procedure TNetDirThread.Execute; begin try FResult := DirectoryExists( FDirname ); except On E: Exception Do Begin FErr := E.Message; FErrclass := ExceptionClass( E.Classtype ); End; end; end; function TNetDirThread.TestForDir(const dirname: String; timeoutMSecs: Dword): TTestResult; begin FDirname := dirname; Resume; If WaitForSingleObject( Handle, timeoutMSecs ) = WAIT_TIMEOUT Then Begin Result := trTimeout; FreeOnTerminate := true; End Else Begin If Assigned( FErrclass ) Then raise FErrClass.Create( FErr ); If FResult Then Result := trDirectoryExists Else Result := trNoDirectory; End; end;

enter image description here

我在整个应用程序中进行搜索,但没有看到该文件正在导入。

enter image description here

我也尝试过

php artisan route:list

2 个答案:

答案 0 :(得分:1)

它是由于Laravel中的缓存问题而发生的。您必须曾经有一个CommentController,在项目中已删除并重新创建的某个时刻,即使您再次拥有它,项目也找不到它。无论如何,运行以下命令应该可以解决您的问题:

php artisan view:clear
php artisan route:clear
php artisan cache:clear
php artisan config:clear
composer dump-autoload

请参阅说明:https://www.youtube.com/watch?v=Q1ynDMC8UGg

答案 1 :(得分:-1)

检查您的路线(web.php),找到CommentController

它应该在那里,将其删除

问题是您要在web.php下调用CommentController, 但您的控制器文件夹上没有CommentController