This happens when i try to create a user fillament

PS C:\Users\Ricardo Pinheiro\Desktop\My Stuff\Php_Projects\Estagio_8220611> php artisan make:filament-user Name: ❯ Email address: ❯ Password: ❯ Illuminate\Database\QueryException SQLSTATE[HY000]: General error: 20 datatype mismatch (Connection: sqlite, SQL: insert into "users" ("name", "email", "password", "id", "updated_at", "created_at") values (admin, admin123@gmail.com, $2y$12$8uEr9q4YsTL2dcjvnG508OlqDMg3lYUzhi/gy16LzU7ErG/7B5YiC, 01978f48-9e35-715e-a486-e5fb5a7cb7f8, 2025-06-20 21:39:50, 2025-06-20 21:39:50))
at vendor\laravel\framework\src\Illuminate\Database\Connection.php:822 818▕ $this->getName(), $query, $this->prepareBindings($bindings), $e 819▕ ); 820▕ } 821▕ ➜ 822▕ throw new QueryException( 823▕ $this->getName(), $query, $this->prepareBindings($bindings), $e 824▕ ); 825▕ } 826▕ } 1 vendor\laravel\framework\src\Illuminate\Database\Connection.php:568 PDOException::("SQLSTATE[HY000]: General error: 20 datatype mismatch") 2 vendor\laravel\framework\src\Illuminate\Database\Connection.php:568 PDOStatement::execute()
7 Replies
Richard Pinewood
Richard PinewoodOP4mo ago
i am building a fillament and laravel project and whenever i try to run that command it doesnt let me create a admin user its going to be a simple admin dashboard the idea of the project
awcodes
awcodes4mo ago
Did you update your User model and the migrations to use UUIDs?
Richard Pinewood
Richard PinewoodOP4mo ago
with this command : php artisan migrate ? i am going too share the user model i currently have :
` ` <?php

namespace App\Models;

use App\Enums\UserType;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;

class User extends Authenticatable
{
use HasFactory, Notifiable;

protected $keyType = 'string';
public $incrementing = false;

protected $fillable = [
'name',
'email',
'password',
'status',
'type',
];

protected $hidden = [
'password',
'remember_token',
];

protected $casts = [
'email_verified_at' => 'datetime',
'password' => 'hashed',
'status' => 'boolean',
'type' => UserType::class,
];

protected static function boot()
{
parent::boot();

static::creating(function ($model) {
$model->id = (string) \Illuminate\Support\Str::uuid();
});
}
}
` ` <?php

namespace App\Models;

use App\Enums\UserType;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;

class User extends Authenticatable
{
use HasFactory, Notifiable;

protected $keyType = 'string';
public $incrementing = false;

protected $fillable = [
'name',
'email',
'password',
'status',
'type',
];

protected $hidden = [
'password',
'remember_token',
];

protected $casts = [
'email_verified_at' => 'datetime',
'password' => 'hashed',
'status' => 'boolean',
'type' => UserType::class,
];

protected static function boot()
{
parent::boot();

static::creating(function ($model) {
$model->id = (string) \Illuminate\Support\Str::uuid();
});
}
}
awcodes
awcodes4mo ago
No, if you want to use UUIDs for the user there’s a few things that need to be updated.
Richard Pinewood
Richard PinewoodOP4mo ago
wich sections ??
Richard Pinewood
Richard PinewoodOP4mo ago
i fixed thnks

Did you find this page helpful?