The query builder's sole() method to validate multiple records in Laravel 8.x
January 21, 2021 — With the latest release minor of Laravel, i.e. v8.23.0, a really interesting method has been introduced in Laravel’s query builder for situation where you want to get the only record for the matching criteria. But if there are more records for this criteria, there should be some sort of exception.