jeudi 8 mars 2018

Laravel 5.6.7 user always redirected to login page after succeed login

I've a case here, whenever I put the credentials correct, it will take me back to the login page, but if I wrote it wrong, it says that my credentials is wrong, I'm using php artisan make:auth and modified the login page a little bit, I changed it to my own template and already write down all the necessary things that the default login page that generated by the artisan make:auth has.

And it doesn't showing me any error at all, I've no idea what's wrong.

Here is my user.php

namespace Laravel;

use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;

class User extends Authenticatable
{
    use Notifiable;

    protected $table = 'users';
    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [
        'name', 'email', 'password',
    ];

    /**
     * The attributes that should be hidden for arrays.
     *
     * @var array
     */
    protected $hidden = [
        'password',
    ];
}

LoginController.php

namespace Laravel\Http\Controllers\Auth;

use Laravel\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\AuthenticatesUsers;

class LoginController extends Controller
{
    /*
    |--------------------------------------------------------------------------
    | Login Controller
    |--------------------------------------------------------------------------
    |
    | This controller handles authenticating users for the application and
    | redirecting them to your home screen. The controller uses a trait
    | to conveniently provide its functionality to your applications.
    |
    */

    use AuthenticatesUsers;

    /**
     * Where to redirect users after login.
     *
     * @var string
     */
    protected $redirectTo = '/dashboard';

    /**
     * Create a new controller instance.
     *
     * @return void
     */
    public function __construct()
    {
        $this->middleware('guest')->except('logout');
    }
}

Is there someone that had a problem like I have? and how to fix it?



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

Aucun commentaire:

Enregistrer un commentaire