Black Friday: coupon FRIDAY24 for 40% off Yearly/Lifetime membership!
Read more here
Building a Laravel form without Illuminate/html
Laravel 5 version got us confused by separating our beloved Form::open world into a separate package. Now you have to add "illuminate/html": "~5.0" to your projects, whenever you want to use forms, right? Not necessary, you can survive without it.
How we would build a simple form with that package:
Now, how it looks if we build it in plain Laravel/HTML:
It's not that bad, is it? The only thing we need to take differently is take care of CSRF protection, which is basically done with method csrf_field().
Another example would be a DELETE form - here we need to use two additional methods.
As you can see, function method_field() is used for adding a hidden field like this:
Then Laravel mechanism would point that form to the correct Controller method delete().
So, the question remains open: do we really need that external illuminate/html Form functionality? Not always. Probably, depends on your skills - which would give you faster results - and on your particular usage in your application.
Which one do you prefer? Do yo use that package? Tell your experience in comments.
No comments or questions yet...