0

这是我的控制器类:

class CallrequestController extends BaseController {

    public function getIndex()
    {
        return View::make('results');
    }

}

保存在:

--app
  --controllers
    --CallrequestController.php

然后我通过作曲家自动加载:
composer dump-autoload

然后我将路由添加到路由文件:

Route::controller('getrequest','CallrequestController');

这是通过 php artisan 路由注册的路由:

+--------+-------------------------------------------------------------------+------+-------------------------------------+----------------+---------------+
| Domain | URI                                                               | Name | Action                              | Before Filters | After Filters |
+--------+-------------------------------------------------------------------+------+-------------------------------------+----------------+---------------+
|        | GET|HEAD /                                                        |      | Closure                             |                |               |
|        | GET|HEAD callrequest/index/{one?}/{two?}/{three?}/{four?}/{five?} |      | CallrequestController@getIndex      |                |               |
|        | GET|HEAD callrequest                                              |      | CallrequestController@getIndex      |                |               |
|        | GET|HEAD|POST|PUT|PATCH|DELETE callrequest/{_missing}             |      | CallrequestController@missingMethod |                |               |
+--------+-------------------------------------------------------------------+------+-------------------------------------+----------------+---------------+

但它没有路由到控制器,我得到默认的“哎呀,看起来出了点问题”。错误信息。

我究竟做错了什么?

编辑这里也是一个示例网址:

mydomainname.com/getrequest
4

0 回答 0