Closed cirelramos closed 5 years ago
Could you send me the migrations file of the users table you're using?
<?php
use App\HR\Auth\Users\User;
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateUsersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('users', function (Blueprint $table) {
$table->increments('id');
$table->string('name');
$table->string('email')->unique();
$table->string('password');
$table->rememberToken();
$table->string('verified');
$table->string('verification_token')->nullable();
$table->string('admin');
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('users');
}
}
model
<?php
namespace App\HR\Auth\Users;
use Laravel\Passport\HasApiTokens;
use Illuminate\Notifications\Notifiable;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Foundation\Auth\User as Authenticatable;
use App\Traits\TextConverter;
/**
* @property int $id_role
* @property string $first_name
* @property string $last_name
* @property string $second_last_name
* @property string $full_name
* @property string $profile_picture
* @property string $email
* @property bool $verified
* @property string $password
* @property string $verification_token
* @property bool $first_time_verification
* @property \Carbon\Carbon $verification_token_created_at
* @property string $admin
* @property int $id_gender
*/
class User extends Authenticatable
{
use Notifiable, HasApiTokens, SoftDeletes, TextConverter;
protected $table = 'users';
protected $dates = ['deleted_at'];
public $userPictureProfile;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'id_role',
'first_name',
'last_name',
'second_last_name',
'full_name',
'profile_picture',
'email',
'verified',
'password',
'verification_token',
'first_time_verification',
'verification_token_created_at',
'admin',
'id_gender',
];
/**
* The attributes that should be hidden for arrays.
*
* @var array
*/
protected $hidden = [
'remember_token',
'verification_token',
];
}
The migration of your users table is using a normal integer field for the id of the user
$table->increments('id')
The migrations of the userstamps is using the bigIncrements
function to work with the recent version of Laravel. You should add the following to your configuration file:
/*
* Define the table column type which is used in the table schema for
* the id of the user
*/
'users_table_column_type' => 'increments',
Please let me know if it works after that. Aren't you receiving an error while migrating?
I made the modifications and I have no errors, but I will create a new project with the version of Laravel that I use to do tests and I tell you
sorry not to respond quickly, you can verify in a project from scratch that I have created, to verify that it is missing ?, thanks in advance, I will leave you the repository link, Apology not respond quickly, you can check in a project that I created from scratch to check missing ?, thanks in advance, I'll leave the link repository
I've found the bug in the package and just released a new version 0.0.4 where the bug has been fixed. I've made a pull request for your example with the corrections/changes in the config file.
I also added a default user in the seeder to have the user quickly available while testing through Tinker. Please let me know if you still have problems using our package.
I've found the bug in the package and just released a new version 0.0.4 where the bug has been fixed. I've made a pull request for your example with the corrections/changes in the config file.
I also added a default user in the seeder to have the user quickly available while testing through Tinker. Please let me know if you still have problems using our package.
yeah it is correct, working perfectly, thanks bro
save the register but not register the user :/ i check with debug a break-point the method and never stop the break-point :S
NOTE: created good the table with field and relations but dont register user