title: How can i use Transaction with Eloquent Laravel 5.5
body: <p>I tried the following code to use Transaction with Eloquent in Laravel 5.5:</p>
  
  <pre><code>DB:: transaction(function () {
  $project = Project::find($id);
  $project-&gt;users()-&gt;detach();
  $project-&gt;delete();
  });
  </code></pre>
  
  <p>I recevied the errors: </p>
  
  <blockquote>
    <p>Method [transaction] does not exist.</p>
  </blockquote>