php - How to add a row to Eloquent Model? -
i using eloquent model form::select
follow:
category::lists('name','id')
and now, want add option all
select categories. how add ? example:
<select> <option>all</option> <option value='1'>cat1</option> <option value='2'>cat2</option> </select>
it simple
$category = category::lists('name', 'id'); form::select("cat",array(""=>"all")+$category);
Comments
Post a Comment