Fetch model ids

PHOTO EMBED

Tue Nov 29 2022 23:31:36 GMT+0000 (Coordinated Universal Time)

Saved by @wjdev

User::all()->pluck('id')->toArray();

// In most cases, however, this can be shortened. Like this:

User::all()->modelKeys();
content_copyCOPY

https://rappasoft.com/blog/15-random-laravel-snippets-methods