[英]Get attribute from config.php of Sentry 2 for Laravel 4
I'm trying to modify the original User.php file within the vendor folder of cartalyt/sentry because I want to register two accounts with the same email but the original code of Sentry is not allowing this feature so I added an attribute to the config.php file 我试图在cartalyt / sentry的vendor文件夹中修改原始的User.php文件,因为我想用同一封电子邮件注册两个帐户,但是Sentry的原始代码不允许此功能,因此我在配置中添加了一个属性.php文件
/app/config/packages/cartalyst/sentry/config.php
But I don't know how to get this attribute to use in this file: 但是我不知道如何在该文件中使用此属性:
/vendor/cartalyst/sentry/src/Cartalyst/Sentry/Users/Eloquent/User.php
Because in that file I can simply add an if to check If I want to register one user per email or register more users with the same email. 因为在该文件中,我可以简单地添加一个if来检查是否要为每封电子邮件注册一个用户,或者用同一封电子邮件注册更多用户。
Or if you have a better idea will be good to know it. 或者,如果您有一个更好的主意,那就很好了。
I hope you can help me! 我希望你能帮帮我!
You dont need to touch that file what you should do is
**remove this**
$table->unique('email');
**from this file**
**your-app/vendor/cartalyst/sentry/src/migrations/2012_12_06_225921_migration_cartalyst_sentry_install_users.php**
That would remove the unique constraint on creating a user with one single email
Then you might need to drop the db or look for a way to re-run the migrations.
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.