A
A
Alexander2022-04-17 16:00:04
PHP
Alexander, 2022-04-17 16:00:04

How to create/sync a Laravel model?

I use the ldaprecord package and upload a list of all users:

$users = User::in('OU=Users,OU=DOMAIN.LOCAL,DC=DOMAIN,DC=local')->whereHas('samaccountname')->orderBy('cn')->get();

I get 300 users. I want to pull up its model for each (samaccountname matches the login in the Users table).
Can you please tell me the best/better way to implement this? It is clear that you can run through foreach, but this is clearly not the right solution ...
User is the LdapRecord\Models\ActiveDirectory model;

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question