Does anybody know how can I set in my select box the first option to empty value?
I\'m getting the data from my DB, and I would like to set the option by default as \"P
In Laravel 5.1 i solved it by doing
$categories = [''=>''] + Category::lists('name', 'id')->toArray(); return view('products.create', compact('categories'));
Or
$categories = [''=>''] + Category::lists('name', 'id')->all(); return view('products.create', compact('categories'));