title: I'm learning laravel 8, and not understanding how this syntax works
body: <p>i'm making an app with a one to many relationships. A user has many posts.</p>
  <p>in the web.php (the route file)</p>
  <p>we wrote</p>
  <pre><code>Route::get('/insert', function () {
      $user=User::findOrFail(1);
      $post= new Post(['title'=&gt;'title1','body'=&gt;'bd1']);
      $user -&gt; posts()-&gt;save($post);
  });
  </code></pre>
  <p>could anyone explain
  the second and third line?</p>
  <pre><code>2- $user=User::findOrFail(1);
  3- $post= new Post(['title'=&gt;'title1','body'=&gt;'bd1']);
  </code></pre>
  <p>why did we write User, new Post? how did this work?</p>