나는 Dayle Rees의 Laravel 튜토리얼을 따라 간단한 등록 페이지를 만들려고합니다.메서드 validateConfirm가 존재하지 않습니다. (Laravel)
유효성 검사 오류로 등록 양식을 제출하면 페이지가 다시로드되고 유효성 검사 오류가 표시됩니다. 이것은 내 register.blade.php입니다
BadMethodCallException
Method [validateConfirm] does not exist.
- - 그러나, 나는 올바른 값으로 키를 제출할 때, 나는 다음과 같은 오류 얻을
<!doctype html>
<html lang="en">
<head>
</head>
<body>
<h1>Registration form</h1>
{{ Form::open(array('url' => '/registration')) }}
{{-- Username field. ------------------------}}
{{ Form::label('username', 'Username') }}
{{ Form::text('username') }}
{{ $errors->first('username', '<span class="error">:message</span>') }}
<br/>
{{-- Email address field. -------------------}}
{{ Form::label('email', 'Email address') }}
{{ Form::email('email') }}
{{ $errors->first('email', '<span class="error">:message</span>') }}
<br/>
{{-- Password field. ------------------------}}
{{ Form::label('password', 'Password') }}
{{ Form::password('password') }}
{{ $errors->first('password', '<span class="error">:message</span>') }}
<br/>
{{-- Password confirmation field. -----------}}
{{ Form::label('password_confirmation', 'Password confirmation') }}
{{ Form::password('password_confirmation') }}
<br/>
{{-- Form submit button. --------------------}}
{{ Form::submit('Register') }}
{{ Form::close() }}
</body>
</html>
을 그리고 이것은 내 routes.php [주 : 내가
Route::get('/', function()
{
return View::make('register');
});
Route::post('/registration', function()
{
// Fetch all request data.
$data = Input::all();
// Build the validation constraint set.
$rules = array(
'username' => 'required|min:3|max:32',
'email' => 'required|email',
'password' => 'required|confirm|min:3'
);
// Create a new validator instance.
$validator = Validator::make($data, $rules);
if ($validator->passes()) {
// Normally we would do something with the data.
return 'Data was saved.';
}
return Redirect::to('/')->withErrors($validator);
});
내가 암호 알림 물건을하려고 내 오류가 방법은 [validatePassword] 존재하지 않는다고 말했습니다 필요합니다. 나는 어디에서 잘못하고 있는지 모른다. – Eenvincible