Reputation: 45
I'm using Confide and Entrust with Laravel 4.
When i try and create a new user, it keeps coming up with a strange error. The users are stored in Admin, and i can edit/select users, but not create them. For some reason, it's somewhere referencing the wrong table. No errors come back or anything, just a SQL error. I cannot seem to find where it comes up though.
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'db.users' doesn't exist (SQL: select count(*) as aggregate from `users` where `username` = ?) (Bindings: array ( 0 => 'blah', ))
That's the SQL error and below is the php code.
$user = new Admin();
$user->username = Input::get('username');
$user->email = Input::get('email');
$user->password = Input::get('password');
$user->save();
Admin Modal: http://pastebin.com/3jEM4dFk
Even though my modal is set to pull everything from Admin, it tries and get's a count from users.
Anyone have any idea?
Upvotes: 1
Views: 565
Reputation: 6565
this was already reported on Zizaco Confide github issues page
What you need is custom validation rules, because by default rules Confide is checking the unique constraint on user table fields.
as @edrands states in his comment:
"I may have solved what was causing the first point. The validation rules are checking for a unique in the users table. I just need custom rules."
Upvotes: 3