You need to keep chaining your query like so
$product = Product::where('active', '=', 'yes');
$input = Input::all();
if(isset($input['type'])):
$product = $product->where('type', '=', $input['type']);
endif;
if(isset($input['date_created'])):
$product = $product->where('created_at', '>', $input['date_created']);
endif;
if(isset($input['code'])):
$product = $product->where('code', '=', $input['code']);
endif;
$product->orderBy('id', 'desc')->get();
As you can see I assign the new where statement to the $product variable, if you try it now you will get the full query ;)