Support the ongoing development of Laravel.io →
Input Database Validation

I have a controller where I am taking an uploaded CSV (which can go up to 5-6MB in size), and I have a transaction running where the CSV gets parsed by phpleague/csv, converted into an associative array (from an iterator), chunked, and processed/inserted in a table that has a unique constraint on four columns.

What would be the best way to check for or catch unique exceptions?

Last updated 3 years ago.
0

Sign in to participate in this thread!

PHPverse

Your banner here too?

mseymour mseymour Joined 25 Feb 2014

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.

© 2025 Laravel.io - All rights reserved.