php - Laravel firstOrNew how to check if it's first or new? - Stack Overflow

PHOTO EMBED

Fri Oct 15 2021 18:16:09 GMT+0000 (Coordinated Universal Time)

Saved by @mvieira #php

if ($user->wasRecentlyCreated) {
    // user just created in the database; it didn't exist before.
} else {
    // user already existed and was pulled from database.
}
content_copyCOPY

https://stackoverflow.com/questions/30686880/laravel-firstornew-how-to-check-if-its-first-or-new