rydurham / Sentinel

A Sentry bridge package for Laravel
http://www.ryandurham.com/projects/sentinel/
317 stars 68 forks source link

Additional fields #205

Closed yokes-g-wiredelta closed 8 years ago

yokes-g-wiredelta commented 8 years ago

Hello Rydurham, how can i add extra fields to the Users?,... while creating the user and edit a user, thanks in advance i can see the vendors/rydurham/Sentinel/src/Controllers, User and Group controller is there but how do i able to add additional fields like, country, address, zip code and city thanks in advance.

rydurham commented 8 years ago

In the config file there is an array where you can specify the additional fields you want to add for a user. Manually add those inputs to your published views and then specify the input names in the config array and the controller will save them when it creates a new user.

yokes-g-wiredelta commented 8 years ago

Hello @rydurham thanks alot for your quick reply, you mean config/sentinel.php correct?,., Even can you please explain bit briefly to how to handle with vendor files in rydurham/sentinel , because i have already done with this plugin to implement more features, can you kindly please let me know if any wiki or any reference please.

rydurham commented 8 years ago

Generally speaking it is considered bad practice to make changes to any files within the vendor directory. Depending on what you are trying to do, you are better off either injecting the third party classes into your application controllers (or other classes) and adding the custom logic there, or by creating your own version of the desired functionality, which could be done by starting from scratch or forking the repository.

yokes-g-wiredelta commented 8 years ago

Ok i agree with that, but can you please specify exactly where i need to modify the changes regarding for adding additional fields, other than that, all the features are perfect, i am really stuck with adding a new filed in to sentinel view files, thanks in advance.

rydurham commented 8 years ago

The best way to handle those types of edits is to publish the package views into your app directory:

php artisan sentinel:publish

This will create a copy of the views that you can then edit without causing conflicts with the vendor directory. There are more details in the readme.