Laravel调试404路由

Ale*_*lex 9 php http-status-code-404 laravel laravel-routing

好的,routes.php我使用的完整文件...我只是粘贴在这里:http://pastebin.com/kaCP3NwK

routes.php文件

//The route group for all other requests needs to validate admin, model, and add assets
Route::group(array('before' => 'validate_admin|validate_model'), function()
{
    //Model Index
    Route::get('admin/(:any)', array(
        'as' => 'admin_index',
        'uses' => 'admin@index'
    ));
Run Code Online (Sandbox Code Playgroud)

管理员配置:

...
'models' => array(
'news' => array(
    'title' => 'News',
    'single' => 'news',
    'model' => 'AdminModels\\News',
),
...
Run Code Online (Sandbox Code Playgroud)

链接生成器:

@foreach (Config::get('administrator.models') as $key => $model)
    @if (Admin\Libraries\ModelHelper::checkPermission($key))
        <?php $key = is_numeric($key) ? $model : $key; ?>
        <li>
            {{ HTML::link(URL::to_route('admin_index', array($key)), $model['title']) }}
        </li>
    @endif
@endforeach
Run Code Online (Sandbox Code Playgroud)

控制器/ admin.php的

public function action_index($modelName)
{
    //first we get the data model
    $model = ModelHelper::getModelInstance($modelName);

    $view = View::make("admin.index",
        array(
            "modelName" => $modelName,
        )
    );

    //set the layout content and title
    $this->layout->modelName = $modelName;
    $this->layout->content = $view;
}
Run Code Online (Sandbox Code Playgroud)

所以,当访问http://example.com/admin/newsnews被发送到action_index......,但由于某种原因,它不到达那里和返回404

Ale*_*lex 5

请注意,我定义了以下内容 'model' => 'AdminModels\\News',

实际上我的namespace寄存器是Admin\Models,所以将它设置'model' => 'Admin\Models\\News',为我的 404 问题