【发布时间】:2014-08-04 12:15:23
【问题描述】:
当我将 Route::resource('api', 'ApiController'); 添加到我的 app/Http/routes.php 时,我收到此错误:
BadMethodCallException 方法 [index] 不存在。
我的 api 控制器如下所示:
<?php
class ApiController extends BaseController
{
public function getIndex()
{
echo "No Access";
}
public function postIndex()
{
// content here ...
}
public function check_ban($user, $gameBit, $ip)
{
// content here ...
}
public function check_balance($userid, $gameid, $serverid)
{
// content here ...
}
public function purchase_item($xml)
{
// content here ...
}
public function LoginRequest($xml)
{
// content here ...
}
public function CurrencyRequest($xml)
{
// content here ...
}
public function ItemPurchaseRequest($xml)
{
// content here ...
}
}
我的 api 应该处理游戏登录请求、购买物品、禁止检查等,但我收到上述错误。
请问如何解决?
【问题讨论】:
标签: php laravel namespaces ioc-container