I've so trouble adding columns to users table with Sentinel.
What I did :
- Creating my own migration file to add (for now) 1 column : "adress"
- Creating a class "User" in app/Http/Controller
namespace App\Http\Controllers;
use Cartalyst\Sentinel\Users\EloquentUser;
class User extends EloquentUser {
protected $fillable = [
'email',
'password',
'last_name',
'first_name',
'permissions',
'adresse',
];
}
Changing the model in config/cartalyst.sentinel.php
'model' => 'Cartalyst\Sentinel\Users\EloquentUser',
to
'model' => 'App\Http\Controllers\User',
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 !