laravel-5cartalyst-sentinel

Laravel Cartalyst Sentinel - Can't extend EloquentUser


I've so trouble adding columns to users table with Sentinel.

What I did :

    namespace App\Http\Controllers;


    use Cartalyst\Sentinel\Users\EloquentUser;

    class User extends EloquentUser {

        protected $fillable = [
            'email',
            'password',
            'last_name',
            'first_name',
            'permissions',
            'adresse',
        ];


    }

But, adresse stay empty in database.

I've tried my code with

     $credentials = [
            'email'    => 'john.dode@example.com',
            'password' => 'password',
            'adresse' => 'password',
        ];

        $user = Sentinel::create($credentials);
        dd($user);

And the result of dd($user) is :

EloquentUser {#392 ▼


 #table: "users"
  #fillable: array:5 [▼
    0 => "email"
    1 => "password"
    2 => "last_name"
    3 => "first_name"
    4 => "permissions"
  ]
  [...]

I don't want to add my fields in the vendors, but it's the only solutions working right now ...

Edit : I've tried to follow EXACTLY this https://github.com/cartalyst/sentinel/wiki/Extending-Sentinel but same result here ...

UPDATE

My problem seem to be deeper than expected ... If I change \vendor\cartalyst\sentinel\src\config\config.php it's working pretty well. So my config/cartalyst.sentinel.php is completly ignore by Sentinel ...

Thanks guys !


Solution

  • Ok ... so, I figured out what was the issue thanks to Laravel Sentinel referencing the wrong config file

    I was using

    use Cartalyst\Sentinel\Native\Facades\Sentinel;
    

    instead of

    use Sentinel;
    

    So, I was just following the doc ... great job !