custom fields


@if(count($flight->field_values)) @endif @foreach($flight_fields as $field) @php $val_field = $flight->field_values->where('name', $field->name)->first(); @endphp @endforeach
Name Value
{{ $field->name }} {{ $val_field['value'] ?? '' }} {{ Form::open(['url' => '/admin/flights/'.$flight->id.'/fields', 'method' => 'delete', 'class' => 'pjax_form pjax_flight_fields' ]) }} {{ Form::hidden('field_id', $val_field['id'] ?? null) }}
{{ Form::button('', ['type' => 'submit', 'class' => 'btn btn-sm btn-danger btn-icon', 'onclick' => "return confirm('Are you sure?')"]) }}
{{ Form::close() }}

{{ Form::open([ 'url' => '/admin/flights/'.$flight->id.'/fields', 'method' => 'post', 'class' => 'pjax_form form-inline pjax_flight_fields' ]) }} {{ Form::label('name', 'Name:') }} {{ Form::text('name', null, ['class' => 'form-control']) }}    {{ Form::label('value', 'Value:') }} {{ Form::text('value', null, ['class' => 'form-control']) }}    {{ Form::button(' add', ['type' => 'submit', 'class' => 'btn btn-success btn-s']) }}

{{ $errors->first('name') }}

{{ $errors->first('value') }}

{{ Form::close() }}