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 - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -