Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The user register page doesn't work. #44

Closed
byhongda opened this issue Nov 25, 2015 · 5 comments
Closed

The user register page doesn't work. #44

byhongda opened this issue Nov 25, 2015 · 5 comments

Comments

@byhongda
Copy link

I installed as the instructions and it almost works.
But in the user register page(ex. http://localhost/auth/user/register), I met such a problem:
After the register information is input and submitted, it shows the follow exception error:

1/1 ErrorException in Model.php line 2335: in_array() expects parameter 2 to be array, null given

  1. in Model.php line 2335
  2. at HandleExceptions->handleError('2', 'in_array() expects parameter 2 to be array, null given', '/Users/byhongda/phpstormProjects/lavalite/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php', '2335', array('key' => 'name'))
  3. at in_array('name', null) in Model.php line 2335
  4. at Model->isFillable('name') in Model.php line 421
  5. at Model->fill(array('name' => 'test', 'email' => 'test@some.com', 'password' => '$2y$10$Fenri1O5Boyy2qX.CknOCeCEsYEcZlCsPRN40oxogIvI.FdUoZaMy', 'active' => false, 'user_id' => null)) in UserRepository.php line 50
  6. at UserRepository->create(array('name' => 'test', 'email' => 'test@some.com', 'password' => '$2y$10$Fenri1O5Boyy2qX.CknOCeCEsYEcZlCsPRN40oxogIvI.FdUoZaMy', 'active' => false)) in User.php line 74
  7. at User->create(array('name' => 'test', 'email' => 'test@some.com', 'password' => '$2y$10$Fenri1O5Boyy2qX.CknOCeCEsYEcZlCsPRN40oxogIvI.FdUoZaMy')) in Facade.php line 214
  8. at Facade::__callStatic('create', array(array('name' => 'test', 'email' => 'test@some.com', 'password' => '$2y$10$Fenri1O5Boyy2qX.CknOCeCEsYEcZlCsPRN40oxogIvI.FdUoZaMy'))) in AuthController.php line 133
  9. at User::create(array('name' => 'test', 'email' => 'test@some.com', 'password' => '$2y$10$Fenri1O5Boyy2qX.CknOCeCEsYEcZlCsPRN40oxogIvI.FdUoZaMy')) in AuthController.php line 133
  10. at AuthController->create(array('name' => 'test', 'email' => 'test@some.com', 'password' => '123456', '_token' => 'n24FjseDuf2MXZPLXzPzMlhr6bHLLRdKQaaqsQKf')) in RegistersUsers.php line 38
  11. at AuthController->postRegister(object(Request), 'user')
  12. at call_user_func_array(array(object(AuthController), 'postRegister'), array(object(Request), 'role' => 'user')) in Controller.php line 256
  13. at Controller->callAction('postRegister', array(object(Request), 'role' => 'user')) in ControllerDispatcher.php line 164
  14. at ControllerDispatcher->call(object(AuthController), object(Route), 'postRegister') in ControllerDispatcher.php line 112
  15. at ControllerDispatcher->Illuminate\Routing\{closure}(object(Request))
  16. at call_user_func(object(Closure), object(Request)) in Pipeline.php line 139
  17. at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in RedirectIfAuthenticated.php line 42
  18. at RedirectIfAuthenticated->handle(object(Request), object(Closure))
  19. at call_user_func_array(array(object(RedirectIfAuthenticated), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
  20. at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
  21. at call_user_func(object(Closure), object(Request)) in Pipeline.php line 103
  22. at Pipeline->then(object(Closure)) in ControllerDispatcher.php line 114
  23. at ControllerDispatcher->callWithinStack(object(AuthController), object(Route), object(Request), 'postRegister') in ControllerDispatcher.php line 69
  24. at ControllerDispatcher->dispatch(object(Route), object(Request), 'App\Http\Controllers\Auth\AuthController', 'postRegister') in Route.php line 203
  25. at Route->runWithCustomDispatcher(object(Request)) in Route.php line 134
  26. at Route->run(object(Request)) in Router.php line 704
  27. at Router->Illuminate\Routing\{closure}(object(Request))
  28. at call_user_func(object(Closure), object(Request)) in Pipeline.php line 139
  29. at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
  30. at call_user_func(object(Closure), object(Request)) in Pipeline.php line 103
  31. at Pipeline->then(object(Closure)) in Router.php line 706
  32. at Router->runRouteWithinStack(object(Route), object(Request)) in Router.php line 671
  33. at Router->dispatchToRoute(object(Request)) in Router.php line 631
  34. at Router->dispatch(object(Request)) in Kernel.php line 236
  35. at Kernel->Illuminate\Foundation\Http\{closure}(object(Request))
  36. at call_user_func(object(Closure), object(Request)) in Pipeline.php line 139
  37. at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in VerifyCsrfToken.php line 50
  38. at VerifyCsrfToken->handle(object(Request), object(Closure))
  39. at call_user_func_array(array(object(VerifyCsrfToken), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
  40. at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in ShareErrorsFromSession.php line 49
  41. at ShareErrorsFromSession->handle(object(Request), object(Closure))
  42. at call_user_func_array(array(object(ShareErrorsFromSession), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
  43. at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in StartSession.php line 62
  44. at StartSession->handle(object(Request), object(Closure))
  45. at call_user_func_array(array(object(StartSession), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
  46. at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in AddQueuedCookiesToResponse.php line 37
  47. at AddQueuedCookiesToResponse->handle(object(Request), object(Closure))
  48. at call_user_func_array(array(object(AddQueuedCookiesToResponse), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
  49. at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in EncryptCookies.php line 59
  50. at EncryptCookies->handle(object(Request), object(Closure))
  51. at call_user_func_array(array(object(EncryptCookies), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
  52. at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in CheckForMaintenanceMode.php line 42
  53. at CheckForMaintenanceMode->handle(object(Request), object(Closure))
  54. at call_user_func_array(array(object(CheckForMaintenanceMode), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
  55. at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
  56. at call_user_func(object(Closure), object(Request)) in Pipeline.php line 103
  57. at Pipeline->then(object(Closure)) in Kernel.php line 122
  58. at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 87
  59. at Kernel->handle(object(Request)) in index.php line 53

And nothing new was inserted into the 'users' table.
What's wrong with this, did I missed any configuration ? or sth wrong with the Eloquent's mass assignment ?

@byhongda
Copy link
Author

It is a problem with the Eloquent's mass assignment.
The fillble property of the User model is initialed by the config file, as follows:

$this->fillable = config('user.user.fillable');

How ever, the "user.php" config file is not in the "config" directory, but in the "package" directory which is in the "config" directory.
So, how to deal with the "package" directory?
I juts pull all the files of the "package" directory into the "config" directory, but it still doesn't work..says:

FatalErrorException in Model.php line 986:
Class 'Lavalite\User\Role' not found

@bugzbrown
Copy link

Hi, I am new to LavaLite and Laravel - probably not a very good combination :)
Yet, I've managed to "temporarily" fix the situation by copying the vendor/lavalite/user/config/config.php file to /config/user.php
I know it probably is not the correct way to tackle this, but, never the less... at least I can create users.

@byhongda
Copy link
Author

Yes, I did it similarly. I just pull the user.php from the "package"
directory to its upper directory.
And I also copied a new Role.php to the proper directory. And finally it
worked...
That's not graceful. Uh.. so I just turned to the BootstrapCMS project.

2015-11-27 22:48 GMT+08:00 Gregory Brown notifications@github.com:

Hi, I am new to LavaLite and Laravel - probably not a very good
combination :)
Yet, I've managed to "temporarily" fix the situation by copying the
vendor/lavalite/user/config/config.php file to /config/user.php
I know it probably is not the correct way to tackle this, but, never the
less... at least I can create users.


Reply to this email directly or view it on GitHub
#44 (comment).

@Renfos
Copy link
Member

Renfos commented Dec 1, 2015

Replace this two file form the git repository.

app/Http/Controllers/Auth/AuthController.php
app/Http/Controllers/UserController.php

@Renfos Renfos closed this as completed Dec 1, 2015
@byhongda
Copy link
Author

byhongda commented Dec 1, 2015

Glad to see you have updated!
btw, I also found the "$this->role" bug~~

gmail(byhongda)

From: Renfos Technologies
Date: 2015-12-01 12:29
To: LavaLite/cms
CC: byhongda
Subject: Re: [cms] The user register page doesn't work. (#44)
Replace this two file form the git repository.
app/Http/Controllers/Auth/AuthController.php
app/Http/Controllers/UserController.php

Reply to this email directly or view it on GitHub.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants