user_id) AND $ao->email) { $o = User::where('email',$ao->email)->first(); if (! $o) { $o = new User; $o->id = $ao->id; $o->site_id = $ao->site_id; $o->email = $ao->email; $o->password = $ao->password; $o->active = $ao->active; $o->title = $ao->title; $o->firstname = $ao->first_name; $o->lastname = $ao->last_name; $o->country_id = $ao->country_id; $o->address1 = $ao->address1; $o->address2 = $ao->address2; $o->city = $ao->city; $o->state = $ao->state; $o->postcode = $ao->zip; $o->save(); } $ao->user_id = $o->id; $ao->save(); } } } }