Open gekkedev opened 4 years ago
As the documentation you linked says:
By default, Laravel uses the
username
method on your LoginController:
username
is a customization of email
not name
, it's also done in the Controller so I don't know how we could get that info inside the Command.
Anyway PR are welcome :+1:
Version information
Description
Laravel provides various customization options including a method to specify the name of the field serving as username:
I changed this field's name to
username
using the provided method and adjusted the initial user table migration. Voyager works fine when it accesses the email field, but when it works with the name field, SQL errors surface quickly. This affects thevoyager:admin
command and possibly other functionality as well.The query being run begins with
which does not respect the username customization.
Steps To Reproduce
Steps to reproduce the behavior:
php artisan voyager:admin --create
Expected behavior
The expectation would be to run a query like
Additional context
While heavy customization could break one's neck, the built-in way to change the username field exists for at least 3 major Laravel releases and is documented in several tutorials which makes it worthwhile being supported by Voyager as well.