Support the ongoing development of Laravel.io →
Database Eloquent
Last updated 2 years ago.
0

In case this is only example, you need to do input validation and that solves your problem. (see manual)

In case that this are real tables merge them.

0
Solution

I would use 'transactions'. They were designed just for such cases.

http://laravel.com/docs/5.0/database (chapter 'Database Transactions')

http://fideloper.com/laravel-database-transactions

Last updated 9 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

archer3cl archer3cl Joined 7 Mar 2015

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.