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.
Published on Nov 11th, 2019.
Understand.io is used by hundreds of Laravel developers to find and fix errors.
Sign up for a free 14-day trial now.