msurguy / Honeypot

Simple spam prevention package for Laravel applications
maxoffsky.com/code-blog/implementing-honeypot-spam-prevention-in-laravel-applications/
MIT License
429 stars 44 forks source link

Remove formbuilder macro, use the facade. #35

Closed garygreen closed 9 years ago

garygreen commented 9 years ago

@msurguy how do you feel about this one? Of course a breaking change so would need a major version bump but I think currently a lot of issues spawn from usage of the macro on FormBuilder. These issues range from supporting legacy Laravel < 4.2, newer Laravel >= 4.2.. and now that illuminate/html has been deprecated it's been replaced with another package called Laravel Collective which runs under a different namespace but is essentially the new illluminate/html.

That's a lot to support and keep up with when all it's doing is just adding a macro which isn't really worth it imo. Doing Honeypot::getFormHtml(...) vs Form::honeypot(...) isn't really much of a difference.

As this is a breaking change, I've also added in this commit a rename of the method getFormHtml to simply generate -- it's possibly a nice time to make the change as read's nicer in it's usage:

{{ Honeypot::getFormHtml() }} {{ Honeypot::generate() }}

Let me know what you think :smile:

msurguy commented 9 years ago

Thanks for the PR @garygreen! I agree that it's time to drop the dependency on Illuminate/html because we're not using it for anything complex here. Have you tested this new version with some of the Laravel versions? I will be able to merge and release if you have!

garygreen commented 9 years ago

Have tested as working on 4.0, 4.1, 4.2, 5.0

msurguy commented 9 years ago

Thanks so much @garygreen! I will release a new tag right now