📅  最后修改于: 2022-03-11 14:54:01.545000             🧑  作者: Mango
$item = Item::firstOrCreate(['title' => 'Example Item']);
if ($item->wasRecentlyCreated === true) {
// item wasn't found and have been created in the database
} else {
// item was found and returned from the database
}