bishopb / laravel-forums

Forums and discussion boards for Laravel 4
GNU General Public License v2.0
15 stars 11 forks source link

User class duplication #13

Open egdavid opened 9 years ago

egdavid commented 9 years ago

You should give the BishopB\Forum\User class a different name, since most of the Laravel applications already have a working User class.

Or another option would be to give a different 'One-to-one mapping' example:

use \BishopB\Forum\User as FUser; //(F for Forum)

And then:

function create_an_app_user() { // make this app user a member moderator $user = UserRepository::createWithRoles( [ 'Name' => 'Jane Q. Doe', 'Password' => FUser::crypt_password('the-initial-password', 'vanilla'), 'HashMethod' => 'vanilla', ], [ RoleRepository::member(), RoleRepository::moderator() ] ); }

naneri commented 9 years ago

Yeah, because a lot of begginer users can just blindly copy the code and they won't understand what caused the error.