Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/laravel/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Laravel-通往关闭的路线_Php_Laravel_Routing - Fatal编程技术网

Php Laravel-通往关闭的路线

Php Laravel-通往关闭的路线,php,laravel,routing,Php,Laravel,Routing,我对MVC并不陌生,但对拉雷维尔来说是个新手。我已经设法用WAMP在Windows 8.1上安装了它。我转到根URL(http://localhost/public/)并获取Laravel徽标和“You have arrival.”行文本 现在我想玩一玩,告诉我下面的代码应该可以工作 <?php /* |-------------------------------------------------------------------------- | Application Rout

我对MVC并不陌生,但对拉雷维尔来说是个新手。我已经设法用WAMP在Windows 8.1上安装了它。我转到根URL(
http://localhost/public/
)并获取Laravel徽标和“You have arrival.”行文本

现在我想玩一玩,告诉我下面的代码应该可以工作

<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the Closure to execute when that URI is requested.
|
*/

Route::get('/', function()
{
    return View::make('hello');
});

Route::get('users', function () {
    return 'users!';
});

路由文件中的代码应该如下所示

Route::get('/users', function () {
    return 'users!';
});

试试看

你的密码没问题为什么我要404?在我进行更改后是否需要重新运行某些内容?您是否按照设置了web服务器?您是否尝试使用
/users
而不是
users
?我不确定为什么它对您不起作用,但我只是将您的代码复制到本地安装,并按预期工作,奇怪的是,文档中没有提到预斜杠。谢谢