2014-04-28 2 views
1

기본 인증을 시도하고 있으며 많은 문제가 있습니다. 내가 양식을 보내call_user_func_array()는 매개 변수 1이 유효한 콜백이 될 것으로 기대합니다. 클래스 'Illuminate Auth Guard'에 'attemp'메소드가 없습니다. - Laravel의 인증

블레이드 인증하려고 할 때, 주된 일이

enter image description here

이 오류가

{{ Form::open(array('url' => 'usuario')) }} 

        <input type="text" class="text" id="email" name="email" placeholder="Correo" {{(Input::old('email')) ? 'value ="'. Input::old('email').'"' : '' }}> 
        <p>{{ $errors->first('email') }}</p> 
        <input type="text" class="text" id="password" name="password" placeholder="Contraseña" > 
        <p>{{ $errors->first('password') }}</p> 


       {{ Form::submit('Ingresar', array('class' => 'bg1')) }} 
{{ Form::close() }} 

경로

Route::post('usuario', array('as' => 'usuario', 'uses' => '[email protected]')); 

모델

use Illuminate\Auth\UserInterface; 
use Illuminate\Auth\Reminders\RemindableInterface; 

class Usuario extends Eloquent implements UserInterface, RemindableInterface{ 
protected $table = 'Usuario'; 
protected $primaryKey = 'idUsuario'; 
protected $hidden = array('Contrasena'); 
protected $fillable = array(
         'Nombre', 
         'Apellido', 
         'Tipo', 
         'Contrasena', 
         'Correo', 
         'Fono', 
         'Foto' 
         ); 
} 

컨트롤러

class UsuarioController extends BaseController{ 

public function doLogin(){ 
    $rules = array(
        'email' => 'required|email', 
        'password' => 'required' 
        ); 
    $validator = Validator::make(Input::all(), $rules); 
    if($validator->fails()){ 
     return Redirect::to('usuario')->withErrors($validator)->withInput(Input::except('password')); 
    }else{ 

     $userdata = array(
      'Correo' => Input::get('email'), 
      'Password' => Input::get('password') 
      ); 

     if(Auth::attemp($userdata)){ 
      return View::make('hello'); 
     }else{ 
      return Redirect::to('usuario'); 
     } 

    } 
} 
} 

인증

'driver' => 'database', 
'model' => 'Usuario', 
'table' => 'Usuario', 

제발, 어떻게 고칠 수 있습니까? attempattempt해야

답변

5

때문에 :

if(Auth::attemp($userdata)) 

은 다음과 같아야합니다

if(Auth::attempt($userdata)) 
+1

jajaja의 감사, 층 (8) : D – cheloncio

관련 문제