@extends('adminlte::page')
@section('title','Kategorije')
@section('content')
<h2 class="m-0 text-dark">{{$item->name}}</h2>
@if ($errors->any())
<div class="row">
    <div class="alert alert-danger">
        <ul>
            @foreach ($errors->all() as $error)
            <li>{{ $error }}</li>
            @endforeach
        </ul>
    </div>
</div>
@endif
{!! Form::open(
    array(
        'url' => route('admin/categories.update',$item),
        'method' => 'PUT',
        'class' => 'form-horizontal',
        'id' =>'categories-form',
        'role'=>'form',
        )) 
!!}
<div class="box box-primary">
    <!-- form start -->
    <div class="row">
        <div class="box-body col-md-3">
            <div class="form-group">
                {!! Form::label('name', 'Naziv kategorije') !!}
                {!! Form::text('name',$item->name,['class'=>'form-control'])!!}
            </div>
        </div>
        <div class="box-body col-md-3">
            <div class="form-group">
                {!! Form::label('parent_id', 'Pripadajuća kategorija') !!}
                {!! Form::select('parent_id',$categories,$item->parent_id,['class'=>'form-control','role' => 'textbox'])!!}
            </div>
        </div>
        <div class="box-body col-md-3">
            <div class="form-group">
                {!! Form::label('status', 'Status') !!}
                {!! Form::select('status',$status,$item->status,['class'=>'form-control','role' => 'checkbox'])!!}
            </div>
        </div>
    </div>
</div>
{!! Form::submit(Lang::get('Snimi'), array('class' => 'btn btn-success')) !!}
{!! Form::close()!!}
@endsection