Did you know modelsKeys()
eloquent collection method? It returns the primary keys from models collection.
1$users = User::active()->limit(3)->get();2 3$users->modelsKeys(); // [1, 2, 3]
Tip given by @iamharis010
Did you know modelsKeys()
eloquent collection method? It returns the primary keys from models collection.
1$users = User::active()->limit(3)->get();2 3$users->modelsKeys(); // [1, 2, 3]
Tip given by @iamharis010