Search code examples
laravel-5.1laravel-form

Laravel5.1: hide a portion of code form view


Here I've a portion of code which I don't want to show in the user interface.

<div class="form-group">
     <label for="customer_id" class="col-sm-4 control-label">{{trans('sale.customer')}}</label>
     <div class="col-sm-8">
          {!! Form::select('customer_id', $customer, Input::old('customer_id'), array('class' => 'form-control')) !!}
     </div>
</div>

I want this section to be hidden. Laravel form has form::hidden() method to do this but how can I apply this in my form::select() method. Thanks in advance.


Solution

  • If you need to hide entire "form-group" div from UI add css property style="display:none" to "form-group" div. and also if you don't want customer_id field in request add 'disabled'=>true to array of 4th parameter after class.