mardi 13 septembre 2016

How Can I change Default table for Auth::attempt() in laravel 5.0

I'm new to laravel and i am creating a authentication page i need to check the values for authentication in my own table but laravel is checking in users table

as my knowledge we can give in the user model

protected $table='my_own_table';

but i don't want to do this is there any way to change the default table of

Auth::attempt()

here is my code

function handleLogin(Request $request){
$data=$request->only('email','password');
if(\Auth::attempt($data))
{
   return "true";       
}
return "false";
}

in the above code when i excute it will check in the user table but i need to check in my_own_table is there any solution with out overriding the properties in the User model.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire