Answer the question
In order to leave comments, you need to log in
Laravel 5 authorization error?
I'm trying to login, but an error occurs:
ErrorException in Guard.php line 430:
Argument 1 passed to Illuminate\Auth\Guard::login() must be an instance of Illuminate\Contracts\Auth\Authenticatable, instance of App\User given
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Contracts\Auth\Authenticatable;
class User extends Model
{
protected $table = 'users';
protected $fillable = array('username', 'tel');
}
<?php
namespace App\Http\Controllers;
use App\User;
use Auth;
use Redirect;
use Illuminate\Database\Eloquent;
class AuthController extends Controller {
public function Login() {
...
Auth::login($user);
return Redirect::to('/');
...
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question