X
X
XenK2015-10-30 12:05:29
Laravel
XenK, 2015-10-30 12:05:29

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

Model User.php :
<?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');
}

Controller AuthController.php :
<?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

1 answer(s)
3
3luyka, 2015-10-30
@3luyka

https://github.com/laravel/laravel/blob/master/app... Here you will see the difference between your model and standard Laravel.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question