TIP 60 / 100

Find a Single Record from a Database.

The sole() method will return only one record that matches the criteria. If no such entry is found, then a NoRecordsFoundException will be thrown. If multiple records are found, then a MultipleRecordsFoundException will be thrown.

php
DB::table('products')->where('ref', '#123')->sole();