laracasts / URL-Shortener

For demo at Laracasts.com
http://laracasts-url.eu1.frbit.net/
84 stars 55 forks source link

A validation issue #4

Open FadyAyad opened 9 years ago

FadyAyad commented 9 years ago

when you validate the hash you make sure that is unique, but what if the hash that the UrlHasher class creates is already in the database? You throw a ValidationException and returns back to the user without telling him what went wrong. What you should have done is making sure that the LittleService class gets a unique hash from the UrlHasher before trying to inject it in the database.