I tried with the default user
table for Laravel Auth purpose,
Now i am changing it to the admin
Table
So i refereed here
Accordingly i tried to change the Table name as admin
in the auth.php
'model' => 'User',
'table' => 'users',
to
'model' => 'AdminModel',
'table' => 'admin',
And in the AdminModel i have protected $table = 'admin';
And i got the error
Class AdminModel contains 6 abstract methods and must therefore be declared abstract or implement the remaining methods (Illuminate\Auth\UserInterface::getAuthIdentifier, Illuminate\Auth\UserInterface::getAuthPassword, Illuminate\Auth\UserInterface::getRememberToken, ...)
Is there anything is should change rather than here ?
Here is my AdminModel :
<?php
use Illuminate\Auth\UserTrait;
use Illuminate\Auth\UserInterface;
use Illuminate\Auth\Reminders\RemindableTrait;
use Illuminate\Auth\Reminders\RemindableInterface;
class AdminModel extends Eloquent implements UserInterface, RemindableInterface
{
protected $table = 'admin';
protected $fillable = array('UserName', 'Password');
public $timestamps = true;
public static $rules = array();
}
Update :
I replaced with appropriate changes
i.e.,
use UserTrait, RemindableTrait;
Solved,
It didn't ended in success
I checked
if (Auth::attempt(array('UserName' => $UserName, 'password' => $password)))
{
return Redirect::intended('dashboard');
}
else
{
$queries = DB::getQueryLog();
print_r(end($queries));
}
And it is always printing the query like this
Array ( [query] => select * from `admin` where `UserName` = ? limit 1 [bindings] => Array ( [0] => a ) [time] => 1 )
What might be the issue ?