🔥 Laravel tip: the sole method
Feb 15, 2022
You can use the sole method to make sure you have one record matching a query.
If the record is not found, it will throw `ModelNotFoundException`.
But, if more than one record is found, it will throw `MultipleRecordsFoundException`
If the record is not found, it will throw `ModelNotFoundException`.
But, if more than one record is found, it will throw `MultipleRecordsFoundException`
Other tips:
🔥 Laravel Tip: wherePivot.
Oct 19, 2022