April 25, 2024 / 1 min read Null Coalesce Assignment Operator laravel Use the null coalesce assignment operator (??=) to assign a value to a variable if the variable is null. // Before (Using the null coalesce operator)$user->name = $user->name ?? 'guest'; // After (Using the null coalesce assignment operator)$user->name ??= 'guest';