@extends('layouts.master') @section('content')

Añadir nuevo producto

@if($product->getErrors()->count() > 0)
    @foreach($product->getErrors()->all() as $error)
  • {{$error}}
  • @endforeach
@endif {{Form::model($product, [ 'action' => $product->exists ? ['AdminMacProductsController@update', $product->id] : 'AdminMacProductsController@store', 'method' => $product->exists ? 'PUT' : 'POST', 'files' => true ])}}
{{Form::label('name', 'Nombre corto')}} {{Form::text('name', NULL, ['class' => 'form-control'])}}
{{Form::label('description', 'Descripción')}} {{Form::textarea('description', NULL, ['class' => 'form-control', 'rows' => 3])}}
{{Form::label('model', 'Modelo')}} {{Form::text('model', NULL, ['class' => 'form-control'])}}
{{Form::label('mac_category_id', 'Categoría')}} {{Form::select('mac_category_id', ($product->category ? [] : [NULL => 'Sin especificar']) + MacCategory::lists('name', 'id'), NULL, ['class' => 'form-control','id' => 'category_id'])}}
{{Form::label('max_stock', 'Maximo')}} {{Form::text('max_stock', NULL, ['class' => 'form-control'])}}
{{Form::label('image', 'Imagen')}} {{Form::file('image')}}
{{Form::submit('Guardar', ['class' => 'btn btn-primary btn-lg'])}}
{{Form::close()}}
@stop