You can wrap the foreach in a DB::transaction to require all inserts to successfully process else none will commit.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community