jeudi 3 décembre 2015

Route [method] not defined

I am creating a form to insert data into database.version laravel5.1 but my code is not working. resources\views\login.blade.php

<!-- Registration Form -->

            <form action="{{ URL::route('postform_registration') }}" role="form" id="login_popup_form" method="post" name="login_popup_form">
                <input type="hidden" name="_token" value="{{ csrf_token() }}">

                    <img id="close" src="{{ URL::asset('tradextek/img/close_irtiza.png') }}" alt="" onclick ="div_hide()">
                    <h2>Registration</h2>

                    <hr>

                    <div class="form-group">
                    <label for="">Your Email</label>
                    <input type="text" class="form-control" id="login_popup_email" name="login_popup_email" placeholder="Email" type="text">
                    </div>

                    <hr>


                <div class="form-group">
                    <label for="">Your Password</label>
                    <input type="password" class="form-control"id="login_popup_password" name="login_popup_password" placeholder="Password...">
                </div>
                    <hr>

                    <button type="submit" onclick="check_empty()" class="btn btn-primary">Submit</button>
            </form>
            <h3>
                <?php
                if(Session::has('key')){
                    echo Session::get('key');
                }
                ?>
            </h3>
        </div>

routes.php

 Route::post('/login',array(
        'as' => 'postform',
        'uses' => 'all_control@postform'
    ));

    Route::post('/login',array(
        'url' => 'postform_registration',
        'uses' => 'all_control@postform_registration'
    ));

app/controllers/all_control

public function postform_registration(Request $request)
    {
        $email = $request->login_popup_email;
        $password = $request->login_popup_password;
        return redirect('login')->with('key', 'You have inserted successfully');

    }

Error message 1)ErrorException in UrlGenerator.php line 296: Route [postform] not defined. (View: C:\xampp\htdocs\project\resources\views\login.blade.php)

2)InvalidArgumentException in UrlGenerator.php line 296: Route [postform] not defined.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire