🔥 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: The `whereRelation` method
Oct 18, 2022
🔥 Laravel Tip: The upsert method
May 2, 2022