title: Laravel creating a relationship out of an view - best practice?
body: <p>I defined a relationship
  Author - Book</p>
  <p>then i am able to create a new book by doing this</p>
  <pre><code>$author = new author();
  $author-&gt;books()-&gt;create();
  </code></pre>
  <p>that works and also doing this in my view</p>
  <pre><code>{{$author-&gt;books()-&gt;create()}}
  </code></pre>
  <p>So every time the site is loaded i create a new book. I try to embed it in a small script with a button.</p>
  <pre><code>&lt;button onclick=&quot;addBook()&quot;&gt;Add new book&lt;/button&gt;
  
  &lt;p id=&quot;addBook&quot;&gt;&lt;/p&gt;
  
  &lt;script&gt;
  function addBook() {
    document.getElementById(&quot;addBook&quot;).innerHTML = {{$author-&gt;books()-&gt;create()}};
  }
  &lt;/script&gt; 
  </code></pre>
  <p>The Script is loaded on pageload and of course executed without neccesary pressed the button.</p>
  <p>What is the best practise?
  Is this an intended way to do such?
  Or should i better make an POST call out of an form and handle the creation in the controller?</p>