抱歉,找不到您要查找的页面且不显示任何错误:Laravel 5.5

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/45992984/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 17:49:34  来源:igfitidea点击:

Sorry, the page you are looking for could not be found without showing any error : Laravel 5.5

laravellaravel-5.5

提问by Sujeesh S

Newly installed Laravel 5.5 showing Sorry, the page you are looking for could not be found. without any error . Please see the screenshot : enter image description here

新安装的 Laravel 5.5 显示 抱歉,找不到您要查找的页面。没有任何错误。请看截图: 在此处输入图片说明

I think its not even looks into routes file, this is my routes.php and htaccess enter image description here

我认为它甚至没有查看路由文件,这是我的 routes.php 和 htaccess 在此处输入图片说明

enter image description here

在此处输入图片说明

What will be the reason for this ?

这是什么原因?

回答by Arthur Samarcos

All your WEB routes will be located in the file:

您所有的 WEB 路由都将位于文件中:

routes\web.php

Register your routes there.

在那里注册您的路线。

回答by chebaby

Order

命令

Pay attention to routes order, it's really important (fooled me so many times to be honest).

注意路由顺序,这真的很重要(老实说骗了我很多次)。

Because Laravel goes through list of routes top to bottom until it finds the first match, as a rule of thumb, try to define routes with no parametres first then routes with parameters in your route file (web/api).

因为 Laravel 从上到下遍历路由列表,直到找到第一个匹配项,所以根据经验,尝试首先定义没有参数的路由,然后在路由文件 (web/api) 中使用参数进行路由。

Example: (based on Radical's answer)

示例:(基于Radical回答

Route::get('/blog/{id}', 'BlogController@show');

Route::get('/blog/comments', 'BlogController@comments');

In this case, Route::get('/blog/{id}', 'BlogController@show');comes first so it would be selected. Even when what you really want is Route::get('/blog/comments', 'BlogController@comments');

在这种情况下,Route::get('/blog/{id}', 'BlogController@show');首先出现所以它会被选中。即使你真正想要的是Route::get('/blog/comments', 'BlogController@comments');

My two cents :)

我的两分钱 :)

回答by Zezi Reeds

I ran into this issue when findOrFailmethod failed in the Controller method.

findOrFailController 方法中的方法失败时,我遇到了这个问题。

回答by Precious Nanle Luke

There are a lot of reasons why this won't work

这行不通的原因有很多

  1. Probably the route was written well eg: Route::get('/boost/{type}/{{type_id}}', ['uses' => 'RequestController@getBoosted', 'as'=>'boosts/{{type}}/{{type_id}}']);when it is meant to be like this: Route::get('/boost/{type}/{type_id}', ['uses' => 'RequestController@getBoosted', 'as'=>'boosts/{type}/{type_id}']);Looking at the two above code the second route is correct because of the curly brackets are one instead of two

  2. Probably you will be needing to clear your cache which happens at rare occasions

  3. Probably the developer in question did not put the links properly at there controllers Return view('site.block')you must make sure that the page that is referenced is at the correct location

  1. 可能路线写得很好,例如:Route::get('/boost/{type}/{{type_id}}', ['uses' => 'RequestController@getBoosted', 'as'=>'boosts/{{type}}/{{type_id}}']);当它是这样的:Route::get('/boost/{type}/{type_id}', ['uses' => 'RequestController@getBoosted', 'as'=>'boosts/{type}/{type_id}']);查看上面的两个代码,第二条路线是正确的,因为大括号是一个而不是两个

  2. 您可能需要清除缓存,这在极少数情况下发生

  3. 可能有问题的开发人员没有将链接正确放置在控制器上,Return view('site.block')您必须确保引用的页面位于正确的位置

回答by Keval Mangukiya

I think you can use this commands:

我认为您可以使用以下命令:

  1. php artisan config:cache
  2. php artisan view:clear
  1. php artisan config:cache
  2. php artisan view:clear

these commands use and I hope your error solve

这些命令使用,我希望你的错误解决

回答by gaborkorodi

Ensure that your register.blade.phpis in the resources/viewsdirectory and remove the trailing slash from the URL you are assigning to this view.

确保您register.blade.phpresources/views目录中并从您分配给此视图的 URL 中删除尾部斜杠。

Sometimes the error messages in the storage/logs/laravel.loglog file (if you have the default configuration) can help as well.

有时storage/logs/laravel.log日志文件中的错误消息(如果您有默认配置)也有帮助。