Return 302 status in form Submit

Asked

Viewed 30 times

1

I did the migration of my project Aravel 5.4 pro 5.6, but in a new form I am having the return 302 when giving the Submit in the form, it is a normal form like the many others in my system, however this one is with this return...

302

Must be something I’m missing, but I’m not finding... maybe it’s because today is Monday rs...

Below the codes:

resume.blade.php

<form action="{{route('renovaPlano')}}" method="post">
        <div class="col-md-12">
            <div class="row">
                <div class="col-xs-12 col-md-6">
                    <div class="col-xs-12">
                        <h2> Selecione o plano:</h2>
                    </div>
                    <div class="col-xs-12">
                        <select name="plano">
                            <option value="0"></option>
                            @foreach($planos as $plano)
                                <option value="{{$plano->id}}">{{$plano->descricao}}</option>
                            @endforeach
                        </select>
                    </div>
                    <div class="col-xs-12" id="loader-busca" style="height: 60px;width: 100%; display: none">
                        <div class='loader-busca'>
                            <div class='loader-busca--dot'></div>
                            <div class='loader-busca--dot'></div>
                            <div class='loader-busca--dot'></div>
                            <div class='loader-busca--dot'></div>
                            <div class='loader-busca--dot'></div>
                            <div class='loader-busca--dot'></div>
                            <div class='loader-busca--text'></div>
                        </div>
                    </div>
                    <div class="col-xs-12" style="margin-top: 18px;">
                        <div class="col-md-6" style="margin:0; padding: 0">
                            <div class="form-group">
                                <input type="number" name="numeronotas" readonly>
                                <span class="highlight"></span>
                                <span class="bar"></span><label style=" top:-15px !important;
                                                                        font-size:14px !important;
                                                                        color:#5264AE !important;">Doc. Fiscais/Mês</label>
                            </div>
                        </div>
                        <div class="col-md-6" style="margin:0; padding: 0">
                            <div class="form-group">
                                <input type="number" name="usuarios" readonly>
                                <span class="highlight"></span>
                                <span class="bar"></span><label style=" top:-15px !important;
                                                                        font-size:14px !important;
                                                                        color:#5264AE !important;">Usuários</label>
                            </div>
                        </div>
                    </div>
                    <div class="col-xs-12">
                        <div class="form-group">
                            <input type="number" name="valor" readonly>
                            <span class="highlight"></span>
                            <span class="bar"></span><label style=" top:-15px !important;
                                                                    font-size:14px !important;
                                                                    color:#5264AE !important;">Valor</label>
                        </div>
                    </div>
                </div>
                <div class="col-xs-12 col-md-6">
                    <div class="panel panel-default credit-card-box">
                        <div class="panel-heading" style="min-height: 40px;">
                            <div class="col-md-7" >
                                <h3 class="panel-title display-td">Meio de pagamento</h3>
                            </div>
                            <div class="col-md-5">
                                <i class="fa fa-2x fa-cc-visa"></i><i class="fa fa-2x fa-cc-mastercard"></i>
                            </div>                    
                        </div>
                        <div class="panel-body">
                            <div class="row text-center">
                                <h4>Dados do proprietário do cartão*</h4>
                            </div>
                            <div class="row">
                                <div class="col-xs-12">
                                    <div class="form-group">
                                        <label for="cardNumber" style=" top:-15px !important;
                                                                        font-size:14px !important;
                                                                        color:#5264AE !important;">Nome completo</label>
                                        <div class="form-group">
                                            <input 
                                                type="text"
                                                class="form-control"
                                                name="cardName"
                                                placeholder="Nome (conforme escrito no cartão)"
                                                data-toggle="tooltip" title="O campo nome deverá ser preenchido exatamente como está informado na frente de seu cartão de crédito."
                                                autocomplete="cc-name"
                                                maxlength="100" size="100"
                                                required autofocus 
                                            />
                                        </div>
                                    </div>                            
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-xs-8">
                                    <div class="form-group">
                                        <label for="cardNumber" style=" top:-15px !important;
                                                                        font-size:14px !important;
                                                                        color:#5264AE !important;">cpf</label>
                                        <div class="form-group">
                                            <input 
                                                type="tel"
                                                class="form-control"
                                                name="cpf"
                                                placeholder="CPF"
                                                autocomplete="cpf"
                                                maxlength="100" size="100"
                                                required 
                                            />
                                        </div>
                                    </div>                            
                                </div>
                                <div class="col-xs-4">
                                    <div class="form-group">
                                        <label for="cardNumber" style=" top:-15px !important;
                                                                        font-size:14px !important;
                                                                        color:#5264AE !important;">Nascimento</label>
                                        <div class="form-group">
                                            <input 
                                                type="tel"
                                                class="form-control"
                                                name="birthDate"
                                                placeholder="dd/mm/aaaa"
                                                autocomplete="dt-nasc"
                                                data-toggle="tooltip" title="Data de nascimento no formato dia/mês/ano."
                                                maxlength="120" size="120"
                                                required
                                            />
                                        </div>
                                    </div>                            
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-xs-12">
                                    <div class="form-group">
                                        <label for="cardNumber" style=" top:-15px !important;
                                                                        font-size:14px !important;
                                                                        color:#5264AE !important;">Número do cartão</label>
                                        <div class="input-group">
                                            <input 
                                                type="tel"
                                                class="form-control"
                                                name="cardNumber"
                                                placeholder="Número do cartão"
                                                autocomplete="cc-number"
                                                maxlength="120" size="120"
                                                required
                                            />
                                            <span class="input-group-addon"><i class="fa fa-credit-card"></i></span>
                                        </div>
                                    </div>                            
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-xs-7 col-md-7">
                                    <div class="form-group">
                                        <label for="cardExpiry" style=" top:-15px !important;
                                                                        font-size:14px !important;
                                                                        color:#5264AE !important;"><span class="hidden-xs">Expira em</span><span class="visible-xs-inline">Data</span></label>
                                            <input 
                                                type="tel" 
                                                class="form-control" 
                                                name="cardExpiry"
                                                placeholder="MM / AA"
                                                autocomplete="cc-exp"
                                                data-toggle="tooltip" title="Data de expiração do cartão, geralmente encontrado na frente do cartão, como 'Válido até:'."
                                                maxlength="10" size="10"
                                                required 
                                            />
                                    </div>
                                </div>
                                <div class="col-xs-5 col-md-5 pull-right">
                                    <div class="form-group">
                                        <label for="cardCVC" style="    top:-15px !important;
                                                                        font-size:14px !important;
                                                                        color:#5264AE !important;">CVC</label>
                                            <input 
                                                type="tel" 
                                                class="form-control"
                                                name="cardCVC"
                                                placeholder="CVC"
                                                autocomplete="cc-csc"
                                                data-toggle="tooltip" title="O campo CVC pode ser encontrado na parte de trás do cartão, próximo ao local de assinatura."
                                                maxlength="4" size="4"
                                                required
                                            />
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-xs-12">
                                    <p class="small btn-danger text-center">* estes dados não são armazenados.</p>
                                </div>
                            </div>
                            <div class="row" style="display:none;">
                                <div class="col-xs-12">
                                    <p class="payment-errors"></p>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-xs-12">
                                    <input type="submit" class="btn btn-success btn-block" value="Finalizar">
                                </div>
                            </div>
                        </div>
                    </div>            
                </div>
            </div>
        </div>
    </form>

route

Route::post('empresa/renova', 'EmpresaController@renova')->name('renovaPlano');

Note: the route is not using any specific middleware...

Empresacontroller.php

public function renova(Request $request){
    //deveria chegar aqui
    dd($request);

    //telefone
    $empresa = Empresa::where('id', Auth::user()->idempresa)->first();

    $celular = preg_replace("/[^0-9]/","", $empresa->telefone());
    $ddd = substr($celular, 0,2);
    $numeroCel = substr($celular, 2);

    //...//

}

Edit

No error is shown, just refresh the page as if Submit had worked...

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.