📅  最后修改于: 2022-03-11 14:54:04.400000             🧑  作者: Mango
// Null Coalesce Operator in PHP (Laravel) - $statement ?? ''
$categoryName = $category->name ?? 'Not Available';
// The above Statement is identical to this if/else statement
if (isset($category->name)) {
$categoryName = $category->name;
} else {
$categoryName = 'Not Available';
}