Comment retourner la variable de la transaction Laravel

$result = null;
DB::transaction(function () use(&$result) { 
    // logic here
    $result = someGetResult();
});
if ($result != null) {

}
Sajana Ashen