Php 用laravel中的post数据提交

Php 用laravel中的post数据提交,php,laravel,Php,Laravel,我在提交表格时遇到了麻烦。按submit后,表示找不到控制器。即使我已经在我的控制器类中定义了。我想要的是在控制器的getLoginauth函数中获取post数据 查看页面 <div class="panel-body"> <?php echo Form::open(array('action' => 'PortalController@getLoginauth')); ?> <

我在提交表格时遇到了麻烦。按submit后,表示找不到控制器。即使我已经在我的控制器类中定义了。我想要的是在控制器的getLoginauth函数中获取post数据

查看页面

<div class="panel-body">
                 <?php echo Form::open(array('action' => 'PortalController@getLoginauth')); ?>
                        <fieldset>
                            <div class="form-group">
                                <input class="form-control" placeholder="E-mail" name="email" type="email" autofocus>
                            </div>
                            <div class="form-group">
                                <input class="form-control" placeholder="Password" name="password" type="password" value="">
                            </div>
                            <div class="checkbox">
                                <label>
                                    <input name="remember" type="checkbox" value="Remember Me">Remember Me
                                </label>
                            </div>
                            <!-- Change this to a button or input when using this as a form -->
                            <input type = "submit" class="btn btn-lg btn-success btn-block" value = "Login"/>
                        </fieldset>
                    <?php echo Form::close();?>
                </div>
路由页面

Route::get('/', function()
{
return View::make('hello');
});

Route::controller('account' , 'AccountController');
Route::controller('admin' , 'PortalController');
Route::post('admin/loginauth', 'PortalController@getLoginauth');

您的表单格式不正确:

您有这样一条路线:

Route::post('admin/loginauth', 'PortalController@getLoginauth');
在您的视图中,您的Web表单如下所示:

<?php echo Form::open(array('action' => 'PortalController@getLoginauth')); ?>
对于提交按钮,请使用下面的blade命令,在我看来,这要干净得多

{{ Form::submit() }}

我通过将我的控制器函数名从

public function getLoginauth(){ 
    echo 'here';
}

和中的视图页

<?php echo Form::open(array('action' => 'PortalController@getLoginauth')); ?>


您好,谢谢您的评论。然而,在将我的表单操作更改为url之后,我仍然得到“找不到控制器方法”。我需要在其他php文件上设置其他内容吗?
public function getLoginauth(){ 
    echo 'here';
}
 public function postLoginauth(){ 
    echo 'here';
}
<?php echo Form::open(array('action' => 'PortalController@getLoginauth')); ?>
 <?php echo Form::open(array('url' => 'admin/loginauth')); ?>