Anmeldeformular mit Laravel

Im Versuch, erstellen Sie ein einfaches Anmeldeformular auf Laravel, folgende Dayle Rees' tutorial, speziell -> Diese eine

Wenn ich es lade mein Anmeldeformular ist alles in Ordnung. Aber wenn ich eingebe, es sagt

The requested URL /testserver/registration was not found on this server.

Ich bin ein Anfänger, die lernen möchten, Laravel besser, so dass jede Hilfe wird sehr geschätzt!

Dies ist mein register.blade.php

<!doctype html>
<html lang="en">

<head>
</head>

<body>
<h1>Registration Form</h1>

{{ Form::open(array('url' => '/registration')) }}

    <ul class="errors">
    @foreach($errors->all() as $message)
        <li>{{ $message }}</li>
    @endforeach
    </ul>


    {{ -- Username field. ------------------------ }}
    {{ Form::label('username', 'Username') }}
    {{ Form::text('username') }}

    {{ -- Email address field. ------------------- }}
    {{ Form::label('email', 'Email address') }}
    {{ Form::email('email') }}

    {{ -- Password field. ------------------------ }}
    {{ Form::label('password', 'Password') }}
    {{ Form::password('password') }}

    {{ -- Password confirmation field. ----------- }}
    {{ Form::label('password_confirmation', 'Password confirmation') }}
    {{ Form::password('password_confirmation') }}

    {{ -- Form submit button. -------------------- }}
    {{ Form::submit('Register') }}

{{ Form::close() }}
</body>

</html>

- Und das ist meine routes.php

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

Route::post('/registration', function()
{
    $data=Input::all();

    //Build the validation constraint set.
    $rules = array(
        'username'   => 'required|min:5|max:15',
        'email'      => 'required|email',
        'password'   => 'required|alpha_num|confirm|min:8'
    );

    //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);

});

Route::filter('csrf', function()
{
    if (Request::forged()) return Response::error('500');
});

Form Action von der Seite Quell - http://localhost/testserver ist mein root Ordner

<form method="POST" action="http://localhost/testserver/registration" accept-charset="UTF-8"><input name="_token" type="hidden" value="LUE1UWguOcyKSbgRyGchfKppRHab504v9p8uEZhQ">
  • Werfen Sie einen Blick auf den HTML-Code, ist der Formular-url Aktion korrekt gebildet? Ist das eine url verweist, auf Ihren post-route?
  • Hinzugefügt wurde die Aktion " Formular im Bearbeiten!
Schreibe einen Kommentar