On edit forms I have a problem to populate form fields with data stored in DB.
When I use the code snippet from the doc everything's fine. However I need to append a css class to the form field, and this cannot be passed as argument for:
{{ Form::text('email') }}
So I've created the below Form::macro
Form::macro('textclass', function($name, $class = null)
{
return '<input type="text" name="'.$name.'" id="'.$name.'" class="'.$class.'"/>';
});
So I can use this on my views:
{{ Form::textclass('email', 'm-wrap span12') }}
But then the field doesn't get populated with the model data.
Any idea on how to fix this?