@extends('layouts.dashboard') @section('content') .row .col-md-4 .box .box-header.dark %h2 %a{"data-toggle"=>"collapse", "href"=>"#xxx", "aria-expanded"=>"false"} Agregar Categorias #xxx.box-body.collapse {!! Form::open(['route'=> 'category.store','method'=>'POST', 'enctype'=>'multipart/form-data']) !!} .form-group %label.col-md-12.control-label{:for => "description"} Nombre .col-md-12 %input#description.form-control{:name => "description", :required => "", :type => "text", :placeholder => "Ej. Wifi"}/ .form-group %label.col-md-12.control-label{:for => "summary"} Resumen .col-md-12 %input#summary.form-control{:name => "summary", :required => "", :type => "text", :placeholder => "Ej. Productos especializados..."}/ .form-group %label.col-md-12.control-label{:for => "portada"} Imagén de Portada .col-md-12 %input#portada.form-control{:name => "portada", :required => "", :type => "file", :placeholder => "Ej. Wifi"}/ .form-group .col-md-12 %button.btn.btn-primary{:type => "submit"} Registrar {!! Form::close() !!} .col-md-8 .box .box-header.dark %h2 Listado de Categorias .box-body %table.table %tr %th # %th Nombre %th Resumen %th Productos %th @foreach ($categories as $category) %tr %td = $category->id %td %p = $category->description %img{:src=>"{{asset('storage/'.$category->portada)}}", :width=>"150px;"} %td = $category->summary %td = $category->products()->count() %td {!! Form::open(['route'=> ['category.destroy',$category->id],'method'=>'DELETE'])!!} %button.btn.btn-danger.btn-xs{:onclick => "return confirm('¿Estas seguro de eliminar este elemento?');", :type => "submit"} %i.fa.fa-trash {!! Form::close()!!} @endforeach .dker.p-a.text-right {{ $categories->links() }} @endsection