Laravel 使用简单的身份验证驱动程序&x27;未初始化的字符串偏移量:0';
嗨,我一直在研究Laravel框架,但无法让这个身份验证驱动程序工作!返回: 未处理的异常Laravel 使用简单的身份验证驱动程序&x27;未初始化的字符串偏移量:0';,laravel,Laravel,嗨,我一直在研究Laravel框架,但无法让这个身份验证驱动程序工作!返回: 未处理的异常 Message: Uninitialized string offset: 0 Location: C:\wamp\www\site\laravel\auth\drivers\eloquent.php on line 39 我有一个登录控制器,具有: class Login_Controller extends Base_Controller { public $restful = tru
Message:
Uninitialized string offset: 0
Location:
C:\wamp\www\site\laravel\auth\drivers\eloquent.php on line 39
我有一个登录控制器,具有:
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中输入行名称
还有其他人见过这个吗
问候
phil确定找到它,需要通过数组将凭据传递给尝试方法:
<?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');
}
}