vendredi 27 octobre 2017

form not being submitted lavarel

I am building a basic form in lavarel 5.4.22 but it is not being submitted, when i click on submit it stays on the same page just changing the url to something different I used this Route

    Route::post('/contact/submit', 'MessagesController@submit');

This is the controller i made use of

   `<?php

      namespace App\Http\Controllers;

       use Illuminate\Http\Request;

       class MessagesController extends Controller
    {
        public function submit(Request $request){
         this->validate($request, [
              'name' => 'required',
              'email' =>'required'
               ]);
                 return 'SUCCESS';
                    }
                   }; ` 

& here is my contact form

            @extends('layouts.app')

             @section('content')
            <H1>Contact</H1>
            {!! Form::open(['url' => 'contact/submit']) !!}
          <div class="form-group">
            
            
             </div>
          <div class="form-group">
            
        
         </div>
        <div class="form-group">
          
        
        </div>
         <div>
        
         </div>
        {!! Form::close() !!}
      @endsection



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire