confide icon indicating copy to clipboard operation
confide copied to clipboard

Username field not created by confide:migration

Open iforwms opened this issue 10 years ago • 7 comments

I know this is specified in the docs as not being created (It will setup a table containing email, password, remember_token, confirmation_code and confirmed columns, which are the default fields needed for Confide use. Feel free to add more columns to the table later.)

But the sql query checks for username OR email equal to the customer input. As the username column does not exist by default, this throws an error.

iforwms avatar Feb 02 '15 03:02 iforwms

Hi @iforwms-snippets I have same problem with you. You can delete or comment

 'username' => $emailOrUsername

line 103 in file vendor/zizaco/confide/src/Confide/EloquentRepository.php

andhikamaheva avatar Feb 02 '15 06:02 andhikamaheva

Same problem.

As EloquentRepository.php is part of the core package files, I've just added username back into the migration file (replacing ->unique() with ->nullable()).

furey-imagination avatar Feb 02 '15 07:02 furey-imagination

Hi,

Try using the --username option. This will add the username field to the migration.

php artisan confide:migration --username

Also don't forget to use that same --username option for creating the controller:

php artisan confide:controller --username

One immediate problem that occurs is that the username field isn't a required field, but it should be unique according to the database schema. Thus if on the registration form the username isn't entered and there already is a record stored with an empty username, a QueryException (Integrity constraint violation) is given.

gdevlugt avatar Feb 02 '15 08:02 gdevlugt

Gonna fix this asap

Zizaco avatar Feb 03 '15 02:02 Zizaco

Same here :(

tjimenez avatar Mar 25 '15 05:03 tjimenez

Status please. Currently setting up my login. Dont want to use the username or atleast have the possibility to choose.

Donny5300 avatar Aug 24 '15 02:08 Donny5300

@Zizaco

Donny5300 avatar Aug 24 '15 02:08 Donny5300