Laravel:我的应用程序没有被路由

时间:2017-01-05 20:57:15

标签: php laravel

我正在运行我的第一个laravel应用程序,在接下来的几个小时内遇到依赖项安装错误。

对不起它可能是一个小错误,但似乎我找不到。

图片较暗,电脑坏了。

enter image description here

应用程序/ HTTP / routes.php文件

<?php

// view('helloworld') ==> helloworld.blade.php
Route::get('/', function () {
   return view('helloworld');
});

资源/视图/ helloworld.blade.php

<!DOCTYPE html>
<html> 
   <head>
   </head>

   <body>
      <div class = "container">       
         <div class = "content">

         </div>
        <p> Yo test....test..</p>   
      </div>
   </body>

</html>

当我点击http://localhost:8000/时,它会让我(甚至在刷新后):

enter image description here

为什么'/'没有路由?它是laravel 5,最新的。

3 个答案:

答案 0 :(得分:1)

你可以隐姓埋名检查,或者你应该删除welcome.blade.php文件

答案 1 :(得分:1)

在Laravel 5.3中,Http路由文件已切换到routes /目录。

https://laravel.com/docs/5.3/routing#basic-routing

  

所有Laravel路由都在路由文件中定义,这些路由文件位于routes目录中。这些文件由框架自动加载。 routes / web.php文件定义了适用于您的Web界面的路由。这些路由分配了Web中间件组,该组提供会话状态和CSRF保护等功能。 routes / api.php中的路由是无状态的,并被分配了api中间件组。

答案 2 :(得分:1)

您应该在laravel 5.3中的routes/web.php中找到您的网页路线!