title: Laravel transaction return null
body: <p>I am trying to query with db transaction .When my method run that time data inserted correctly in corresponding table.but it return null.</p>
  
  <p>My Code </p>
  
  <pre><code>    return $result = DB::transaction(function() use ($attributes) {
          $service = $this-&gt;service-&gt;create($attributes);
          $visibilityAttributes = $attributes['dropdown_option_id'];
          $visibilityAttributes = array_map('intval', $visibilityAttributes);
          $service-&gt;visibility()-&gt;sync($visibilityAttributes);
      },3);
  </code></pre>