Php 项目送达时,Laravel 4.x中的文件::exists()不工作

Php 项目送达时,Laravel 4.x中的文件::exists()不工作,php,laravel,laravel-routing,Php,Laravel,Laravel Routing,我正在拉威尔4.x开发一个项目。我目前正在使用routes.php上的File::exists函数作为错误陷阱,代码如下所示: Route::get('/', function() { if(File::exists("settings/config.xml") { // do something with the config. // then go to the site. } else { // cannot proceed anymore. } }

我正在拉威尔4.x开发一个项目。我目前正在使用routes.php上的File::exists函数作为错误陷阱,代码如下所示:

Route::get('/', function() {
  if(File::exists("settings/config.xml") {
    // do something with the config.
    // then go to the site.
  }
  else {
    // cannot proceed anymore.
  }
});
我正在WAMP服务器上开发我的项目。一切都很好,它返回真的,直到我为它提供php artisan服务-port=8080。它现在找不到我要找的文件!我找到了另一种工作方式——虚拟主机,但我需要的是在提供服务时检查文件是否存在的方法

我尝试在URL地址栏上键入确切路径,它可以找到浏览器下载的文件,实际上是:localhost:8080/settings/config.xml

我的代码有问题吗?谢谢你的帮助

编辑:
当我说在我完成之前一切都很好时,我指的是通过以下URL运行我的项目:localhost/project/public

可能会在路径中添加斜杠根


如下所示:File::exists/settings/config.xml

文件的本地路径是什么?很抱歉回复太晚。它位于:wamp\www\project\public\settings\config.xml@SafoorSafdar