mercredi 18 octobre 2017

Laravel 5.1 MethodNotAllowedHttpException - Registration

I have a problem with registration. When the user will finish registration then he will get this error message - MethodNotAllowedHttpException in RouteCollection.php line 219. Could you check pls the code if you will the issue that causing this error.

01.) Routes.php

/**
     * Guest only visit this section
     */
    Route::group(['middleware' => 'guest'], function () {
        Route::get('account/login', ['as' => 'login', 'uses' => 'Auth\LoginController@getLogin']);
        Route::get('auth/{provider}', 'Auth\LoginController@getSocial');
        Route::get('auth/{provider}/callback', 'Auth\LoginController@getSocialCallback');
        Route::get('registration/{provider}', 'Auth\RegistrationController@getSocialRegister');
        Route::get('account/registration', ['as' => 'registration', 'uses' => 'Auth\RegistrationController@getIndex']);
        Route::get('registration/activate/{username}/{code}', 'Auth\RegistrationController@validateUser');
        Route::get('password/email', ['as' => 'password.reminder', 'uses' => 'Auth\PasswordController@getEmail']);
        Route::get('password/reset/{token}', 'Auth\PasswordController@getReset');
    });

    /**
     * Guest Post form with csrf protection
     */
    Route::group(['middleware' => 'csrf:guest'], function () {
        Route::post('account/login', 'Auth\LoginController@postLogin');
        Route::post('registration/{provider}', 'Auth\RegistrationController@postSocialRegister');
        Route::post('password/email', 'Auth\PasswordController@postEmail');
        Route::post('password/reset/{token}', 'Auth\PasswordController@postReset');
        Route::post('account/registration', 'Auth\RegistrationController@postIndex');
        Route::get('image/freefiles/{slug}', ['as' => 'images.freefiles', 'uses' => 'ImageController@getFreeFiles']);
    });

02.) login.blade.php

   <form action="" method="POST">
                                    <input type="hidden" name="_token" value="">
                                    <div class="sminputs">
                                        <div class="input full">
                                            <label class="string optional" for="username">username*</label>
                                            <input class="string optional" maxlength="255" id="username" name="username" placeholder="username" type="text" size="50" />
                                        </div>
                                    </div>
                                    <div class="sminputs">
                                        <div class="input full">
                                            <label class="string optional" for="email">Email*</label>
                                            <input class="string optional" maxlength="255" id="email" name="email" placeholder="Email" type="email" size="50" />
                                        </div>
                                    </div>
                                    <div class="sminputs">
                                        <div class="input string optional">
                                            <label class="string optional" for="password">Password *</label>

                                            {!! Form::password('password',['class'=>'form-control input-lg','placeholder'=>t('Enter Password'),'autocomplete'=>'off','required'=>'required']) !!}
                                        </div>
                                        <div class="input string optional">
                                            <label class="string optional" for="password_confirmation">Repeat password *</label>

                                            {!! Form::password('password_confirmation',['class'=>'form-control input-lg','placeholder'=>'Confirm Password','autocomplete'=>'off','required'=>'required']) !!}
                                        </div>
                                    </div>
                                    <div class="simform__actions">
                                        <input class="sumbit" name="commit" type="submit" value="Create Account" />

                                        <span class="simform__actions-sidetext">By creating an account you agree to our <a class="special" href="#" target="_blank" role="link">Terms & Privacy</a></span>
                                    </div>
                                </form>

03.) login_beta.blade.php

  <form action="" class="contact_form2" method="POST">
            <h1 style="text-align: center">Create Your Account</h1>
            <input type="hidden" name="_token" value="">
            <ul id="usn_eml">
                <li>
                    <input type="text" maxlength="255" id="username" name="username" class="textbox1"
                    placeholder="Your username..." required/>
                    <span class="form_hint">Enter username</span>
                </li>
                <li>
                    <input type="email" maxlength="255" id="email" name="email" class="textbox1"
                    placeholder="Your email..." required>
                    <span class="form_hint">Enter email...</span>
                </li>
                <li>
                    {!! Form::password('password',['class'=>'textbox1','placeholder'=>t('Enter Password'),'autocomplete'=>'off','required'=>'required']) !!}
                    <span class="form_hint">Your password...</span>
                </li>
                <li>
                    {!! Form::password('password_confirmation',['class'=>'textbox1','placeholder'=>'Confirm Password','autocomplete'=>'off','required'=>'required']) !!}
                    <span class="form_hint">Confirm password...</span>
                </li>
                                <ol style="clear: both; display: block; padding-top: 17px;">
               
                <div class="form-group">
                    <script src='http://ift.tt/1xQsaAf'></script>

                    <div class="g-recaptcha" data-sitekey="xxxx"></div>
                </div>
            
                           </ol>
                <input name="commit" type="submit" value="Create Account"/>
                
            </ul>

            <style>
                #usn_eml {
                    width: 50%;
                    display: block;
                    margin: auto;
                }
            </style>

            

            <div class="tos">
                By creating an account you agree to our <a
                class="special" href="http://ift.tt/2ywFks0" target="_blank" role="link">Terms &
                Privacy</a>
            </div>

            <div class="already_member">
                <p>Already a member? Please<a id="getSignInDiv" href="#"> Sign In</a></p>
            </div>
        </form>


via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire