Using Laravel Form class to add the 'disabled' attribute

Nyxynyx picture Nyxynyx · Jul 19, 2013 · Viewed 43.6k times · Source

Using Laravel 4's Form class, we can create a list using

 {{ @Form::select('colors', Colors::all()), $color }}

Question: How can we add the attribute disabled using Blade without having to rewrite the clean Blade syntax into the usual ugly form?

Answer

JustinHo picture JustinHo · Jul 19, 2013

Just add array('disabled') in the end like:

{{ Form::select('colors', Colors::all(), $color, array('disabled')) }}