I'm new to php platforms and what I'm trying to do is to pass a variable from the controller to view for populating a dropdown list with entries from the database, but whatever i'm trying is not working. I get the following error:
Undefined variable: products_create
I can't understand what I'm doing wrong.
Controller
public function create()
{
$products_create = categories::all(['id', 'category']);
return View::make('products.create', compact('id', 'category'));
}
View
{!! Form::label('category', 'Categorie') !!}
{!! Form::select('category', $products_create) !!}