Working on adding user to another company

This commit is contained in:
David Bomba 2021-03-01 23:06:24 +11:00
parent 52bf4afd64
commit bf326e6d26

View File

@ -39,9 +39,9 @@ class StoreUserRequest extends Request
$rules['last_name'] = 'required|string|max:100'; $rules['last_name'] = 'required|string|max:100';
if (config('ninja.db.multi_db_enabled')) { if (config('ninja.db.multi_db_enabled')) {
$rules['email'] = ['email', new ValidUserForCompany(), Rule::unique('users')->ignore($this->input('company_user.account.id'), 'account_id')]; $rules['email'] = ['email', new ValidUserForCompany(), Rule::unique('users')->ignore(auth()->user()->company()->account_id, 'account_id')];
} else { } else {
$rules['email'] = ['email',Rule::unique('users')->ignore($this->input('company_user.account.id'), 'account_id')]; $rules['email'] = ['email',Rule::unique('users')->ignore(auth()->user()->company()->account_id, 'account_id')];
} }
@ -56,7 +56,10 @@ class StoreUserRequest extends Request
{ {
$input = $this->all(); $input = $this->all();
nlog($this->input('company_user.account')); //unique user rule - check company_user table for user_id / company_id / account_id if none exist we can add the user. ELSE return false
//nlog($this->all());
//nlog($this->input('company_user.account'));
// nlog($this->input('company_user.account.id')); // nlog($this->input('company_user.account.id'));
// nlog($this->input('company_user.account.id')); // nlog($this->input('company_user.account.id'));