Laravel Route返回404错误

时间:2015-01-23 16:08:39

标签: laravel-4 routing laravel-routing

我有这段代码:

Route::group(array('before'=>'auth'), function() {

    Route::get('cats/create', function() {
        $cat = new Cat;
        return View::make('cats.edit')->with('cat', $cat)->with('method', 'post');
    });
}

在app / routes.php页面

我加了

App::missing(function($exception) {
    return Response::make("Page not found!", 404);
});
app / start / global.php文件中的

我总是得到404错误,但我不明白为什么。

在日志文件中我有:

[2015-01-23 16:01:08] production.ERROR: exception 'Symfony\Component\HttpKernel\Exception\NotFoundHttpException' in C:\wamp\www\laravel\vendor\laravel\framework\src\Illuminate\Routing\Router.php:1221
Stack trace:
#0 [internal function]: Illuminate\Routing\Router->Illuminate\Routing\{closure}('create', Object(Illuminate\Routing\Route))
#1 C:\wamp\www\laravel\vendor\laravel\framework\src\Illuminate\Routing\Router.php(1083): call_user_func(Object(Closure), 'create', Object(Illuminate\Routing\Route))
#2 C:\wamp\www\laravel\vendor\laravel\framework\src\Illuminate\Routing\Router.php(1066): Illuminate\Routing\Router->performBinding('cat', 'create', Object(Illuminate\Routing\Route))
#3 C:\wamp\www\laravel\vendor\laravel\framework\src\Illuminate\Routing\Router.php(1051): Illuminate\Routing\Router->substituteBindings(Object(Illuminate\Routing\Route))
#4 C:\wamp\www\laravel\vendor\laravel\framework\src\Illuminate\Routing\Router.php(1017): Illuminate\Routing\Router->findRoute(Object(Illuminate\Http\Request))
#5 C:\wamp\www\laravel\vendor\laravel\framework\src\Illuminate\Routing\Router.php(996): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request))
#6 C:\wamp\www\laravel\vendor\laravel\framework\src\Illuminate\Foundation\Application.php(775): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request))
#7 C:\wamp\www\laravel\vendor\laravel\framework\src\Illuminate\Foundation\Application.php(745): Illuminate\Foundation\Application->dispatch(Object(Illuminate\Http\Request))
#8 C:\wamp\www\laravel\vendor\laravel\framework\src\Illuminate\Session\Middleware.php(72): Illuminate\Foundation\Application->handle(Object(Illuminate\Http\Request), 1, true)
#9 C:\wamp\www\laravel\vendor\laravel\framework\src\Illuminate\Cookie\Queue.php(47): Illuminate\Session\Middleware->handle(Object(Illuminate\Http\Request), 1, true)
#10 C:\wamp\www\laravel\vendor\laravel\framework\src\Illuminate\Cookie\Guard.php(51): Illuminate\Cookie\Queue->handle(Object(Illuminate\Http\Request), 1, true)
#11 C:\wamp\www\laravel\vendor\stack\builder\src\Stack\StackedHttpKernel.php(23): Illuminate\Cookie\Guard->handle(Object(Illuminate\Http\Request), 1, true)
#12 C:\wamp\www\laravel\vendor\laravel\framework\src\Illuminate\Foundation\Application.php(641): Stack\StackedHttpKernel->handle(Object(Illuminate\Http\Request))
#13 C:\wamp\www\laravel\public\index.php(49): Illuminate\Foundation\Application->run()
#14 C:\wamp\www\laravel\server.php(19): require_once('C:\wamp\www\lar...')

0 个答案:

没有答案