We now understand how to fetch and display records from a linking table. Let's next learn how to perform inserts. We can leverage the
detach() methods to insert one or many records at once. However, we should also perform the necessary validation to ensure that a malicious user doesn't sneak an invalid id.
app/Modelsdirectory. This means an
App\Postnamespace should now be