@extends('layout.master') @section('content') @include('layout.errorform') @include('layout.info') {!! Form::open(['route' => 'category.store', 'class' => 'form-horizontal', 'id' => 'form']) !!}
Add Product Category
{!! Form::label('cate', 'Category :', ['class' => 'col-sm-2 control-label']) !!}
{!! Form::text('category', @$value, ['class' => 'form-control', 'placeholder' => 'Category', 'id' => 'cate']) !!}
{!! Form::submit('Save', ['class' => 'btn btn-primary btn-lg btn-block']) !!}
{!! Form::close() !!}
Product Category List
@if( count($cate) > 0 ) @foreach ($cate as $k) @endforeach
category active action
{!! $k->product_category !!} {!! ( $k->active == NULL ) ? 'inactive' : 'active' !!}
@else @endif
@endsection @section('jquery') ///////////////////////////////////////////////////////////////////////////////////////// // ajax post delete row // readProducts(); /* it will load products when document loads */ $(document).on('click', '.delete_button', function(e){ var productId = $(this).data('id'); SwalDelete(productId); e.preventDefault(); }); // function readProducts(){ // $('#load-products').load('read.php'); // } function SwalDelete(productId){ swal.fire({ title: 'Are you sure?', text: "It will be deleted permanently!", type: 'warning', showCancelButton: true, confirmButtonColor: '#3085d6', cancelButtonColor: '#d33', confirmButtonText: 'Yes, delete it!', showLoaderOnConfirm: true, allowOutsideClick: false, preConfirm: function(){ return new Promise(function(resolve) { $.ajax({ headers: {'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')}, url: '