I am creating parent email form in this form parent insert his email id. I facing problem is when I submit form that showing error ,Method [save] does not exist
and my code is
registration form
<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>
my controller
public function registrationStepTwo()
{
$cemail = $_REQUEST['cemail'];
if($cemail != '')
{
$parent = new Parent;
$parent->email = $cemail;
$parent->save();
}
}
I had the save issues, with the exact same class name "Parent" at it also throws
Method [save] does not exist
The reason you can save the $parent
model data is because of the name that you have given to the model as
Parent
Change the model name to something else and it will work as expected. Looks like the class Parent must be laravel's system class and we cannot give that name to our custom classes.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments