Jump to content

Assigning user pages to page reference array


VeiJari
 Share

Recommended Posts

Hello,

I'm trying to create a page via api and populate values to it. I can populate everything except user pages to a page reference array.

Code: 

$dataUsers = $data->project->users;
  foreach($dataUsers as $dataUser) {
    $newProject->projectUsers->add(wire()->pages->find('template=user, id=' . $dataUser->id));
  }

I'm receiving my data via JSON.

Is there something I'm missing?

Thanks for help

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...