2016-04-17 12 views
1

動作しない私は検証とフォームの提出は

Route::get('/', [ 
    'uses' => '\App\Http\Controllers\[email protected]', 
    'as' => 'auth.signup', 
    ]); 

Route::post('/', [ 
    'uses' => '\App\Http\Controllers\[email protected]',  
    ]); 

signup.blade.phpこの時点で

@extends ('templates.default')  

@section('register') 

<div id="login-page" class="row"> 

     <form class="login-form" method="post" action="{{route('auth.signup')}}"> 
     <div class="row"> 
      <div class="input-field col s12 center"> 
      <h4>Register</h4> 
      <p class="center">Join to our community now !</p> 
      </div> 
     </div> 
     <div class="row margin"> 
      <div class="input-field col s12"> 
      <i class="mdi-social-person-outline prefix"></i> 
      <input id="username" name="username" type="text"> 
      <label for="username" class="center-align">Username</label> 
      @if($errors->has('username')) 
       <div class="error">{{$errors->first('username')}}</div> 
      @endif 
      </div> 
     </div> 
     <div class="row margin"> 
      <div class="input-field col s12"> 
      <i class="mdi-communication-email prefix"></i> 
      <input id="email" name="useremail" type="email"> 
      <label for="email" class="center-align">Email</label> 
      @if($errors->has('email')) 
       <div class="error">{{$errors->first('email')}}</div> 
      @endif 
      </div> 
     </div> 
     <div class="row margin"> 
      <div class="input-field col s12"> 
      <i class="mdi-action-lock-outline prefix"></i> 
      <input id="password" name="userpassword" type="password"> 
      <label for="password">Password</label> 
      @if($errors->has('userpassword')) 
       <div class="error">{{$errors->first('userpassword')}}</div> 
      @endif 
      </div> 
     </div> 
     <div class="row margin"> 
      <div class="input-field col s12"> 
      <i class="mdi-action-lock-outline prefix"></i> 
      <input id="password-again" type="password"> 
      <label for="password-again">Password again</label> 
      </div> 
     </div> 
     <input type="hidden" name="_token" value="{{ Session::token()}}"> 
     <div class="row"> 
      <div class="input-field col s12"> 
      <input type="submit" value="Regiter Now" class="btn waves-effect waves-light col s12"/>    
      </div>   
     </div> 
     </form> 

    </div>  

@stop 

あるAuthController

use Illuminate\Http\Request; 

use ConnectIn\Http\Requests; 

class AuthController extends Controller 
{ 
    public function getSignUp() 
    { 
     return view('auth.signup'); 
    } 

    public function postSignUp(Request $request) 
    { 
     $this -> validate($request, [ 
      'username' => 'required|unique:users|alpha_dash|max:255', 
      'useremail' => 'required|unique:users|email|max:255', 
      'userpassword' => 'required|min:8' 
      ]); 
     //dd("all OK"); 
    } 
} 

と私の経路できました私はどんなエラーも出ませんが、フォームを提出することができず、私の検証はまったくうまくいきません。 postSignUp機能で

+0

フォームアクションとして '' URL( '/')してみてくださいことはできますか? – ImAtWar

答えて

0

にコードを変更:

$this->validate($request->all(), [ 
     'username' => 'required|unique:users|alpha_dash|max:255', 
     'useremail' => 'required|unique:users|email|max:255', 
     'userpassword' => 'required|min:8' 
     ]); 
関連する問題