我遇到了我在 laravel 中遇到的错误。当我在本地主机上运行我的代码时,我没有任何问题,但是当我将 laravel 放在作为服务器('https')的演示实时服务器中时,我得到了 MethodNotAllowedHttpException 错误。
这是我的路线代码
Route::post('post_reminder', function(){
$creds = array(
'email' => Input::get('email')
);
$rules = array(
'email' => 'required|email'
);
$messages = array(
'email' => 'The :attribute needs to be an real email'
);
$validator = Validator::make($creds, $rules,$messages);
if($validator->fails())
{
return Redirect::route('getReminder')->withErrors($validator);
}
else
{
return Password::remind($creds);
}
});
这是表单代码
<div id="reset_container">
{{ Form::open(array('url' => 'post_reminder')) }}
<h1 id="pass_recovery_text">Password Recovery Form</h1>
<p>
@if (Session::has('error'))
<li id="error">{{ trans(Session::get('reason')) }}</li>
@elseif (Session::has('success'))
<li id="error">An e-mail with the password reset has beensent.</li>
@endif
@foreach($errors->all() as $error)
<li id="error">{{ $error }}</li>
@endforeach
{{ Form::label('email', 'Please enter you email: ') }}
{{ Form::text('email','',array('id' => 'forgot')) }}
{{ Form::submit('Reset') }}<br /><br /><br />
{{ HTML::link('/', 'Have a account Sign-In', array('id' => 'sign-in')) }}
</p>
{{ Form::close() }}
</div>