Macroable.php第74行中的BadMethodCallException:方法控制器不存在 [英] BadMethodCallException in Macroable.php line 74 : Method controller does not exist

查看:598
本文介绍了Macroable.php第74行中的BadMethodCallException:方法控制器不存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我遵循Route Controller时,我遇到的问题很少.

I'm getting little bit issue when I follow Route Controller.

Web.php代码:

Web.php Code:

{"
Route::controller('/admin','adminController');
"}

adminController.php代码:

adminController.php Code:

{"
<?php
namespace App\Http\Controllers;
class adminController extends Controller{
public function getDashboard(){
echo " Get Dashborad Method ";
}}
"}

当我点击http://localhost:8000/admin/dashboard 错误:

显示("Macroable.php第74行中的BadMethodCallException:方法控制器不存在.")

Display ("BadMethodCallException in Macroable.php line 74 : Method controller does not exist.")

这是SnapShot:

Here is SnapShot:

请看看,让我知道代码有什么问题.

Please take a look and let me know what is wrong with code.

推荐答案

最近也遇到了同样的问题. Laravel 5.3不支持Route :: controller()方法.您需要将其更改为Route :: get(). 请在此处检查如何使用它 https://laravel.com/docs/5.3/routing #basic-routing .

Faced the same problem recently. Laravel 5.3 does not support Route::controller() method. You need to change it to Route::get(). Please check how to use it here https://laravel.com/docs/5.3/routing#basic-routing.

这篇关于Macroable.php第74行中的BadMethodCallException:方法控制器不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆