Jump to content

Add/Update Client Custom field from within provisioning module.

Recommended Posts

Hi Guys,


I'm trying to make a module that is very dependent on all the products the user has along with the top level product they have.

so, in this case, think of it like I need to know the reseller ID they were assigned before I can link the new domain to the correct internal reseller they have.

So, I figured I'd use client Custom fields to trigger this, but I'm not sure how I'm supposed to save the custom field from within the provisioning module. 

In the spirit of my last example, lets say a user purchases a hosting package. My companies policy is to immediately assign them a reseller package and that happens within the provisioning module, so it creates both the reseller and the hosting package within the reseller.

The next time the user comes along, I want to be able to tell the system "This user already has a reseller, just add the next domain to that reseller".


Now as you can probably figure out, this is NOT infact a reseller account, but the designs are so similar, it's semantics. 


I've tried a few different options:

 $params['client']::find($params['userid'])->customFieldValues->save(['KEY' => rand(100,100000)]);
        Client::find($params['userid'])[0]->customFieldValues->save(['KEY' => rand(100,100000)]);


neither work at all. I believe custom fields are given as apart of the arguments passed to createAccount, so shouldn't be much of an issue getting the details, only setting.


Any help is very much appreciated.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated