mercredi 25 février 2015

Authentication laravel 4.2 cannot work


Vote count:

0




Authentication laravel can't work on my program. I have googled but not solve this. My program is


LoginController@auth



public function auth()
{
$username = Input::get('username');
$password = Input::get('pass');
if(Auth::attempt(array('id' => $username, 'password' => $password)))
{
echo "Work";
}
else
{
echo "Bad";
}
}


Authtable.php



<?php

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

class Authtable extends Eloquent implements UserInterface, RemindableInterface
{

protected $table = 'authtable';

protected $hidden = array('password');

/**
* Get the unique identifier for the user.
*
* @return mixed
*/
public function getAuthIdentifier()
{
return $this->getKey();
}

/**
* Get the password for the user.
*
* @return string
*/
public function getAuthPassword()
{
return $this->password;
}

/**
* Get the e-mail address where password reminders are sent.
*
* @return string
*/
public function getReminderEmail()
{
return $this->email;
}

public function getRememberToken()
{
return $this->remember_token;
}

public function setRememberToken($value)
{
$this->remember_token = $value;
}

public function getRememberTokenName()
{
return 'remember_token';
}


}


auth.php



'driver' => 'eloquent',
'model' => 'Authtable',
'table' => 'authtable',


And nullable remember_token(varchar(100)), password(varchar(60)) but still not work. Please give some solution.



asked 19 secs ago







Authentication laravel 4.2 cannot work

Aucun commentaire:

Enregistrer un commentaire