我的身份验证系统不起作用(用laravel 5.1)。你能帮帮我吗?我是拉拉维尔的初学者,当然我忘了一些东西,但我不知道是什么。
我有这样的答复:
FatalErrorException在personne.php第10行中:类‘App\Models\雄辩’找不到
我的auth.php:
'driver' => 'eloquent',
/*
|--------------------------------------------------------------------------
| Authentication Model
|--------------------------------------------------------------------------
|
| When using the "Eloquent" authentication driver, we need to know which
| Eloquent model should be used to retrieve your users. Of course, it
| is often just the "User" model but you may use whatever you like.
|
*/
// 'model' => App\User::class,
'model' => 'App\Models\personne',我的个人课程:
namespace App\Models;
use Illuminate\Auth\Authenticatable;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Auth\Passwords\CanResetPassword;
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract;
class personne extends Eloquent implements UserInterface, RemindableInterface {
protected $table = 'personne';
protected $primaryKey = 'id_personne';
public $timestamps = false; // pour ne pas que laravel update lui même les champs dates de la table
public function getReminderEmail()
{
return $this->email;
}
etc....我的控制器:
namespace App\Http\Controllers;
use Illuminate\Support\Facades\Validator;
use Illuminate\Support\Facades\Input;
use Auth;
class AuthentificationController extends Controller {编辑:我这样改变了人物类:
namespace App\Models;
use Eloquent;
use Illuminate\Auth\Authenticatable;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Auth\Passwords\CanResetPassword;
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract;
class personne extends Model implements UserInterface, RemindableInterface {现在的错误是:
FatalErrorException在personne.php第13行中:找不到界面‘App\Model\UserInterface’
发布于 2015-12-31 12:08:44
发布于 2015-12-31 13:58:46
答案是:
类“personne”必须以下列开头:
namespace App\Models;
use Illuminate\Auth\Authenticatable;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Auth\Passwords\CanResetPassword;
use Illuminate\Foundation\Auth\Access\Authorizable;
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
use Illuminate\Contracts\Auth\Access\Authorizable as AuthorizableContract;
use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract;
class Personne extends Model implements AuthenticatableContract,
AuthorizableContract,
CanResetPasswordContract
{
use Authenticatable, Authorizable, CanResetPassword;现在一切都很好。多米尼克
https://stackoverflow.com/questions/34545833
复制相似问题