2016-02-28 258 views
0

我正在使用Laravel 5.2。我有一個管理面板在我的項目與登錄頁面。擁有有效電子郵件和密碼的用戶可以訪問但我的代碼給我錯誤Laravel用戶登錄系統

ErrorException in UrlGenerator.php line 603: 
Action App\Http\Controllers\[email protected] not defined. (View: E:\xampp\htdocs\blog\resources\views\admin\login.blade.php) 

InvalidArgumentException in UrlGenerator.php line 603: 
Action App\Http\Controllers\[email protected] not defined. 

這裏是我的登錄表單:

{!! Form::open(['class' => 'form-horizontal', 'role' => 'form', 'method' => 'post', 'action' => '[email protected]']) !!} 
         <fieldset> 

          <div class="input-prepend" title="email"> 
           <span class="add-on"><i class="halflings-icon user"></i></span> 
           <input class="input-large span10" name="email" id="email" type="text" placeholder="type email"/> 
          </div> 
          <div class="clearfix"></div> 

          <div class="input-prepend" title="Password"> 
           <span class="add-on"><i class="halflings-icon lock"></i></span> 
           <input class="input-large span10" name="password" id="password" type="password" placeholder="type password"/> 
          </div> 
          <div class="clearfix"></div> 

          <label class="remember" for="remember"><input type="checkbox" id="remember" />Remember me</label> 

          <div class="button-login"> 
           <button type="submit" class="btn btn-primary">Login</button> 
          </div> 
          <div class="clearfix"></div> 
         </fieldset> 
        {!! Form::close() !!} 

這裏是我的控制文件:

​​

這裏是我的路線文件:

Route::get('/admin', '[email protected]'); 


Route::group(['middleware' => 'web'], function() { 
    Route::auth(); 


}); 
+1

你在路由文件中指定了控制器嗎? –

回答

0

嘗試添加命名空間。

{!! Form::open(['class' => 'form-horizontal', 'role' => 'form', 'method' => 'post', 'action' => 'App\Http\Controllers\[email protected]']) !!} <fieldset> 
+0

我在哪裏添加這個命名空間? –

+0

{!! Form :: open(['class'=>'form-horizo​​ntal','role'=>'form','method'=>'post','action'=>'App \ Http \ Controllers \ AdminController @ authenticate '])!!}

Mahmood

0

嘗試將Route::post('/authenticate', '[email protected]');添加到您的路線文件中。然後提交表格/authenticate