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

Popular posts from this blog

android - How to save instance state of selected radiobutton on menu -

python 3 IndexError: list index out of range -

IF statement in MySQL trigger -