所有路由都抛出 NotFoundHttpException,但 home


All routes throw NotFoundHttpException but home

我在路由中得到了这个代码.php:

Route::get('/', array('as' => 'home', function()
{
    return View::make('list.open');
}));
Route::get('room/{name}', array('as' => 'showRoom', 'uses' => 'RoomController@showRoom'));
Route::post('room', array('as' => 'openRoom', 'uses' => 'RoomController@openRoom'));

房间控制器中的这段代码.php:

class RoomController extends Controller {
    public function openRoom()
    {
      return "test";
    }
    public function showRoom($name)
    {
      return "test2";
    }
}
如果我打开 public/

它会向我显示视图列表.open,但如果我打开 public/room/test,它会抛出 NotFoundHttpException。(我还尝试在路由中直接使用函数.php而不是房间控制器,但它不起作用)

谁能帮我?

亲切问候达蒙

您不需要将公用文件夹添加到您的路径中,您只需转到 http://location.com/room/test 即可。

我刚刚重新安装了一个新的 larapack 并删除了旧的......我必须从零开始,但现在它可以工作了。

相关文章:
  • 没有找到相关文章