2013-01-11 2 views
0

안녕하세요 저는 Laravel 프레임 워크를 살펴 봤지만이 인증 드라이버를 사용할 수 없습니다! 반환 :Laravel - 간단한 인증 드라이버 사용 '초기화되지 않은 문자열 오프셋 : 0'

class Login_Controller extends Base_Controller { 

    public $restful = true; 

    public function post_index() 
    { 
     $username = Input::get('username'); 
     $password = Input::get('password'); 

     if (Auth::attempt($username, $password)) 
     { 
      return Redirect::to('home'); 
     } 
     else 
     { 
      return Redirect::to('login')->with('login_errors', true); 
     } 

    } 

    public function get_index() { 

     return View::make('page.login'); 

    } 

} 

내가

가있는 행 이름에 대한 auth.php에 'username' => 'username',

이 : 내가 가진 로그인 컨트롤러가

Message: 

Uninitialized string offset: 0 
Location: 

C:\wamp\www\site\laravel\auth\drivers\eloquent.php on line 39 

처리되지 않은 예외 다른 사람이 이걸 보니?

관련

답변

0

좋아는 그것을 발견 배열에 의해 시도 방법에 자격 증명을 전달해야합니다

<?php 

class Login_Controller extends Base_Controller { 

    public $restful = true; 

    public function post_index() 
    { 
     $username = Input::get('username'); 
     $password = Input::get('password'); 

     if (Auth::attempt(array('username' => $username, 'password' => $password))) 
     { 
      return Redirect::to('home'); 
     } 
     else 
     { 
      return Redirect::to('login')->with('login_errors', true); 
     } 

    } 

    public function get_index() { 

     return View::make('page.login'); 

    } 

} 
관련 문제