adamwathan / form

Super basic form HTML builder, only really exists so I can pull it in for some other more useful projects.
MIT License
232 stars 117 forks source link

Method to get $data #96

Closed sdebacker closed 8 years ago

sdebacker commented 8 years ago

Hello Adam,

I propose this small change to make it possible to get data object. With this feature, we no longer have to make a child class of BoundData in https://github.com/Propaganistas/Laravel-Translatable-Bootforms package.

coveralls commented 8 years ago

Coverage Status

Coverage decreased (-0.2%) to 94.66% when pulling 1c20057faad4ffd9300d46ce2742d4794078e130 on sdebacker:master into 573a4d62f2f9dbdc4e0f173c1c7ded4ca3ccebba on adamwathan:master.

adamwathan commented 8 years ago

Looking at the Translatable Bootforms package to try and understand how this is being used in case there's a better solution, where is this translate() method defined? Is it expecting that you only bind models that implement the translate method?

https://github.com/Propaganistas/Laravel-Translatable-Bootforms/blob/master/src/Form/FormBuilder.php#L44

adamwathan commented 8 years ago

Also I think I would rather just add a data method like in the other package instead of making the first param optional in get. If you can make that change I'll merge this no biggie.

sdebacker commented 8 years ago

The translate method is here : https://github.com/dimsav/laravel-translatable/blob/master/src/Translatable/Translatable.php

I just created a data method. Thank you.

sdebacker commented 8 years ago

After the version bumping, I will make a PR on Propaganistas’ package.

coveralls commented 8 years ago

Coverage Status

Coverage decreased (-0.2%) to 94.647% when pulling 246c361aa98bc7754a7f3e14a0158577f1eeb3ec on sdebacker:master into 573a4d62f2f9dbdc4e0f173c1c7ded4ca3ccebba on adamwathan:master.

sdebacker commented 8 years ago

Hello Adam, do you plan to release a v0.8.8 version that include this new data() method?

adamwathan commented 8 years ago

Whoops, sorry! Done!

sdebacker commented 8 years ago

Nice & Thanks.