@extends('Frontend.Layouts.modal') @section('modal_class', 'modal-md') @section('title') {!! trans('global.edit') !!} @stop @section('body') {!!Form::open(['route' => 'alerts.update', 'method' => 'PUT', 'class' => 'alert-form'])!!} {!!Form::hidden('id', $item->id)!!}
{!!Form::label('name', trans('validation.attributes.name').'*:')!!} {!!Form::text('name', $item->name, ['class' => 'form-control'])!!}
{!! Form::label('devices', trans('validation.attributes.devices').'*:') !!} {!! Form::select('devices[]', $devices , $item->devices->lists('id', 'id')->all(), ['class' => 'form-control multiexpand', 'multiple' => 'multiple', 'data-live-search' => true, 'data-actions-box' => true]) !!}
{!! Form::label('type', trans('validation.attributes.type').':') !!} {!! Form::select('type', array_pluck($types, 'title', 'type'), $item->type, ['class' => 'form-control']) !!}
@foreach($types as $type)
@if ( ! empty($type['attributes'])) @foreach($type['attributes'] as $attribute)
{!!Form::label($attribute['name'], $attribute['title'])!!} @if ($type['type'] == 'custom' && $attribute['type'] == 'multiselect') {!! Form::select($attribute['name'].'[]', array_pluck($attribute['options'], 'items', 'name'), $attribute['default'], ['class' => 'form-control multiexpand half', 'multiple' => 'multiple', 'data-live-search' => true, 'data-actions-box' => true]) !!} @elseif ($attribute['type'] == 'multiselect') {!! Form::select($attribute['name'].'[]', array_pluck($attribute['options'], 'title', 'id'), $attribute['default'], ['class' => 'form-control multiexpand', 'multiple' => 'multiple', 'data-live-search' => true, 'data-actions-box' => true]) !!} @elseif ($attribute['type'] == 'select') {!! Form::select($attribute['name'], array_pluck($attribute['options'], 'title', 'id'), $attribute['default'], ['class' => 'form-control', 'data-live-search' => true]) !!} @else {!! Form::text($attribute['name'], $attribute['default'], ['class' => 'form-control']) !!} @endif @if ( ! empty($attribute['description']))
{!! $attribute['description'] !!}
@endif
@endforeach @endif
@endforeach
@if (!empty($geofences))
{!! Form::hidden('zone', 0) !!}
{!! Form::checkbox('zone', 1, $item->zone == 1) !!} {!! Form::label(null, trans('front.zone_in')) !!}
{!! Form::checkbox('zone', 2, $item->zone == 2) !!} {!! Form::label(null, trans('front.zone_out')) !!}
{!!Form::select('zones[]', $geofences, $item->zones->lists('id', 'id')->all(), ['class' => 'form-control multiexpand disabled', 'multiple' => 'multiple', 'data-live-search' => true, 'data-actions-box' => true])!!}
@else @endif
{!! Form::hidden('schedule', 0) !!}
{!! Form::checkbox('schedule', 1, $item->schedule) !!} {!! Form::label(null, trans('validation.attributes.schedule')) !!}