如何在Laravel-4中保存post表单

如何在Laravel-4中保存post表单,laravel-4,Laravel 4,我正在创建家长电子邮件表单,在此表单中家长插入其电子邮件id。 我面临的问题是,当我提交显示错误的表单时,方法[save]不存在 我的代码是 登记表 <div class="form"> {{ Form::open(array('url' => '/api/v1/parents/registration_step_2', 'class' => "worldoo-form form form-horizontal", 'id' => "signupForm",

我正在创建家长电子邮件表单,在此表单中家长插入其电子邮件id。 我面临的问题是,当我提交显示错误的表单时,
方法[save]不存在
我的代码是

登记表

<div class="form">
    {{ Form::open(array('url' => '/api/v1/parents/registration_step_2', 'class' => "worldoo-form form form-horizontal", 'id' => "signupForm", 'method' => "post" )) }}
      <div class="form-group ">
        {{ Form::label('cemail', 'Please enter your parents e-mail:', array('class' => "control-label"));}}
        <div class="">
          {{ Form::email('cemail', '', array('class' => "form-control", 'id' => "cemail"));}}
          <i class="sprite success form-control-feedback"></i> </div>
        <h5 class="regular-font text-left">Your parents will need to activate your account before you can access worldoo.</h5>
      </div>
      <div class="form-group">
        <div class="text-center">
          {{Form::submit('Next', array('class' => "btn btn-primary"));}}
        </div>
      </div>
    {{ Form::close() }}
</div>

您的模型设置不正确。如果您在app/models/中发现这些模型,则需要一个Parent.php文件来定义laravel应如何使用数据库中的信息

我已经测试过了,这段代码运行正常。可能正在尝试编写器更新

composer update

我有保存问题,它也抛出了完全相同的类名“Parent”

方法[save]不存在

之所以可以保存
$parent
模型数据,是因为您将模型命名为

母公司


将模型名称更改为其他名称,它将按预期工作。看起来类父类必须是laravel的系统类,我们不能给自定义类起这个名字。

您似乎在尝试使用laravel的雄辩模型。您是否声明了您的父模型?你的父模型代码可以吗?另外,对于Laravel-ish方法,使用
Input::get('cemail')
而不是
$\u-REQUEST
不工作,因为相同的错误方法[save]不工作。在Parent.php模型中有五个字段,但我只插入了一个字段,所以这是显示错误的原因…5个字段?你能把你的代码贴在模型上吗
composer update