laravel-bakery
laravel-bakery copied to clipboard
Throw exception when no arguments are passed to the single entity query
Right now we just loop through the arguments, filtering the query. But if you don't supply any arguments and the query returns only model (because there is only one in the database for example) it does not throw any error and return that model. We should check for the amount of argument supplied and throw an exception if that amount is zero.