Default User ID
Closed this issue · 8 comments
Getting error on new Post submission: 'user_id doesn't have a default value'.. Curious what you had setup outside of this package? Are there any requirements?
@activeRobert which version are you using? 0.6.1, right?
Btw, there shouldn't be any particular requirement.
If you have the user model under a namespace other than App\User, you can publish and edit the config file or just set a "BLOGIFY_USER_MODEL" variable in your .env :)
I am using 0.6.1 and I am using all default user authentication provided by Laravel. I assume it should use the current authenticated user, correct?
You actually have to set the author on post creation, atm :)
I'm currently rewriting everything from scratch though, so expect some news in the next days :)
Well in that case, there is actually not an "Author" field that shows. I can probably make that change and submit a PR for inclusion into the package, but if you're re-writing I can just wait.
@activeRobert feel free to fix it if you have time, so we can update the current version with something less broken :)
I don't know how the field disappeared tho
Ok, so I actually found the issue. I have gates & policies setup in my application and it might be helpful for someone else, but if you don't have access to view the users, then the field does not show. This actually throws an error in the posts section because the author is never sent.
I fixed the issue, but nothing was changed in the original code-base
@activeRobert thank you! So maybe we can mention the problem it in the readme file?