Closed akazorg closed 5 years ago
I would suggest an interface that requires the developer to implement a specific method (or methods, if you need more) for you to get the user's name.
I don't think it would be possible to create a command or something to automatically apply this, so you'd have to have documentation. For example, in https://github.com/launcher-host/mercurius/blob/master/docs/customization.md add a section:
'models' => [
'user' => App\Models\User::class,
...
],
class User extends Model implements MercuriusUser
@mikemand great idea for the interface!
I can automate the customization for the User
model, since is already defined in the config, we just need to open this file and change it.
I'll create a branch for this and send some news soon. Thanks for the feedback!
Closing with PR #31.
Currently, we can define a different User model and apply custom fields. The User's name support multiple fields, e.g. first_name
and last_name
.
In the future we might use the User Interface, but for now the system is quite extendable.
We need to be able to extend Users Model. e.g. dealing with User
first_name
andlast_name
see issue #28.idea
MercuriusUser
model to support custom fields;App\User
to extendLauncher\Mercurius\Models\MercuriusUser
;App\User
.I'm not sure what is the best approach on this, please send your feedback.