sleeping-owl / admin

Administrative interface builder for Laravel
http://sleeping-owl.github.io/
MIT License
504 stars 259 forks source link

FormItem::file()->unique() #271

Closed joaomnb closed 9 years ago

joaomnb commented 9 years ago

Hi! I'm currently trying to block a file from being submitted if there is already another file with the same name in the server/database.

I use the method getFileFields() to force the uploaded file to keep the original name... And I need a way to check, when submitting a new file through admin panel, if there is already an equally named file.

I tried using FormItem::file()->unique(), but without success...

Any ideas?

Thank you!

joaomnb commented 9 years ago

Fixed it by creating a Custom Validator, according to Laravel's Documentation.