jeudi 31 décembre 2015

laravel 5 authenticate problems

My authenticate system does not work (with laravel 5.1). Can you please help me ? I am a beginner in Laravel , certainly I forgot something, but I do not know what.

I have this response :

FatalErrorException in personne.php line 10: Class 'App\Models\Eloquent' not found

My 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',

My personne class :

 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....

My controller :

    namespace App\Http\Controllers;

use Illuminate\Support\Facades\Validator;
use Illuminate\Support\Facades\Input;
use Auth;

class AuthentificationController extends Controller {

Thanks a lot.

Dominique



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire