mardi 28 février 2017

auth::attemp not working properly laravel

My login in laravel isnt working properly. I've been stuck here for a long time now. This is my login controller code

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;


class UsersController extends Controller
{
protected function dashboard(Request $request)
{

    if (Auth::attempt(array('account_number'=>$request['accountnumber-login'], 'password'=> $request['txt-password']))) {
        return redirect()->intended('viewdashboard');
    }

} 

protected function viewdashboard()
{
    return view('dashboard');
}
}

..in this controller the 'account-number' is the account number column in the database and the 'password' is the password column in the database. I've done everything correctly yet it does not redirect me to the dashboard view. Please help

and this is my html form

<html>
<form action="dashboard" method="GET">
<input type="number" name="accountnumber">
<input type="password" name="password">
</form

</html>

this is my web route folder

Route::get('dashboard', function(){
return view('dashboard_view');
}

pls help, please.



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2lk3rQH
via IFTTT

Aucun commentaire:

Enregistrer un commentaire