program dan basis data ekosistem
This commit is contained in:
@@ -0,0 +1,96 @@
|
||||
@extends('layout.main')
|
||||
|
||||
@section('content')
|
||||
<div class="container-xxl flex-grow-1 container-p-y">
|
||||
<div class="card">
|
||||
<div class="card-header border-bottom mb-4">
|
||||
<h5 class="card-title mb-0">Tambah Tabel Baru</h5>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<form id="addNewTabelForm" action="{{ route('tabel.store') }}" method="POST" >
|
||||
@csrf
|
||||
|
||||
<h6 class="mb-3">Informasi Tabel</h6>
|
||||
<div class="row">
|
||||
<div class="col-md-3 mb-4 form-control-validation">
|
||||
<label class="form-label" for="add-tabel-nama">Nama Tabel<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control @error('tabel') is-invalid @enderror" id="add-tabel-nama" name="tabel" placeholder="Cth: Tabel Pertanian" value="{{ old('tabel') }}" />
|
||||
@error('tabel')<div class="error invalid-feedback">{{ $message }}</div>@enderror
|
||||
</div>
|
||||
<div class="col-md-3 mb-4 form-control-validation">
|
||||
<label class="form-label" for="add-tabel-label">Label<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control @error('label') is-invalid @enderror" id="add-tabel-label" name="label" placeholder="Cth: budi@email.com" value="{{ old('label') }}" />
|
||||
@error('label')<div class="error invalid-feedback">{{ $message }}</div>@enderror
|
||||
</div>
|
||||
<div class="col-md-3 mb-4 form-control-validation">
|
||||
<label class="form-label" for="add-tabel-menu">Judul Menu<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control @error('menu') is-invalid @enderror" id="add-tabel-menu" name="menu" placeholder="Cth: Pertanian" value="{{ old('menu') }}" />
|
||||
@error('menu')<div class="error invalid-feedback">{{ $message }}</div>@enderror
|
||||
</div>
|
||||
<div class="col-md-3 mb-4 form-control-validation">
|
||||
<label class="form-label" for="add-tabel-group">Kelompok Tabel</label>
|
||||
<select class="form-select @error('group_id') is-invalid @enderror" id="add-tabel-group" name="group_id">
|
||||
<option value="">--- Pilih Kelompok Tabel ---</option>
|
||||
@foreach ($group as $g)
|
||||
<option value="{{ $g->id }}">{{ $g->label }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
@error('group_id')<div class="error invalid-feedback">{{ $message }}</div>@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12 mb-4 form-control-validation">
|
||||
<label class="form-label" for="add-tabel-deskripsi">Deskripsi</label>
|
||||
<input type="text" class="form-control @error('deskripsi') is-invalid @enderror" id="add-tabel-deskripsi" name="deskripsi" placeholder="Cth: Deskripsi tabel pertanian" value="{{ old('deskripsi') }}" />
|
||||
@error('deskripsi')<div class="error invalid-feedback">{{ $message }}</div>@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-4 text-end">
|
||||
<a href="{{ route('tabel.index') }}" class="btn btn-label-secondary me-2">Kembali</a>
|
||||
<button type="submit" class="btn btn-success data-submit">Simpan Tabel</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script>
|
||||
'use strict';
|
||||
$(document).ready(function () {
|
||||
|
||||
$('#add-tabel-group').select2();
|
||||
|
||||
$.validator.addMethod("snakecase", function(value, element) {
|
||||
return this.optional(element) || /^[a-z0-9]+(_[a-z0-9]+)*$/.test(value);
|
||||
}, "Gunakan format snake_case (huruf kecil dan underscore)");
|
||||
|
||||
$('#addNewTabelForm').validate({
|
||||
rules: {
|
||||
tabel: { required: true, snakecase: true },
|
||||
label: { required: true },
|
||||
menu: { required: true }
|
||||
},
|
||||
messages: {
|
||||
tabel: { required: "Nama tabel wajib diisi", snakecase: "Gunakan format snake_case (huruf kecil dan underscore)" },
|
||||
label: { required: "Label wajib diisi" },
|
||||
menu: { required: "Judul menu wajib diisi" }
|
||||
},
|
||||
errorElement: 'div',
|
||||
errorPlacement: function (error, element) {
|
||||
error.addClass('invalid-feedback');
|
||||
element.closest('.mb-6, .form-control-validation').append(error);
|
||||
},
|
||||
highlight: function (element) {
|
||||
$(element).addClass('is-invalid');
|
||||
},
|
||||
unhighlight: function (element) {
|
||||
$(element).removeClass('is-invalid');
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
@@ -0,0 +1,97 @@
|
||||
@extends('layout.main')
|
||||
|
||||
@section('content')
|
||||
<div class="container-xxl flex-grow-1 container-p-y">
|
||||
<div class="card">
|
||||
<div class="card-header border-bottom mb-4">
|
||||
<h5 class="card-title mb-0">Update Data Tabel</h5>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<form id="addUpdateTabelForm" action="{{ route('tabel.update', $tabel->id) }}" method="POST" >
|
||||
@csrf
|
||||
@method('PUT')
|
||||
|
||||
<h6 class="mb-3">Informasi Tabel</h6>
|
||||
<div class="row">
|
||||
<div class="col-md-3 mb-4 form-control-validation">
|
||||
<label class="form-label" for="add-tabel-nama">Nama Tabel<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control @error('tabel') is-invalid @enderror" id="add-tabel-nama" name="tabel" placeholder="Cth: Tabel Pertanian" value="{{ old('tabel', $tabel->tabel) }}" />
|
||||
@error('tabel')<div class="error invalid-feedback">{{ $message }}</div>@enderror
|
||||
</div>
|
||||
<div class="col-md-3 mb-4 form-control-validation">
|
||||
<label class="form-label" for="add-tabel-label">Label<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control @error('label') is-invalid @enderror" id="add-tabel-label" name="label" placeholder="Cth: budi@email.com" value="{{ old('label', $tabel->label) }}" />
|
||||
@error('label')<div class="error invalid-feedback">{{ $message }}</div>@enderror
|
||||
</div>
|
||||
<div class="col-md-3 mb-4 form-control-validation">
|
||||
<label class="form-label" for="add-tabel-menu">Judul Menu<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control @error('menu') is-invalid @enderror" id="add-tabel-menu" name="menu" placeholder="Cth: Pertanian" value="{{ old('menu', $tabel->menu) }}" />
|
||||
@error('menu')<div class="error invalid-feedback">{{ $message }}</div>@enderror
|
||||
</div>
|
||||
<div class="col-md-3 mb-4 form-control-validation">
|
||||
<label class="form-label" for="add-tabel-group">Kelompok Tabel</label>
|
||||
<select class="form-select @error('group_id') is-invalid @enderror" id="add-tabel-group" name="group_id">
|
||||
<option value="">--- Pilih Kelompok Tabel ---</option>
|
||||
@foreach ($group as $g)
|
||||
<option value="{{ $g->id }}" {{ old('group', $tabel->group_id) == $g->id ? 'selected' : '' }}>{{ $g->label }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
@error('group_id')<div class="error invalid-feedback">{{ $message }}</div>@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12 mb-4 form-control-validation">
|
||||
<label class="form-label" for="add-tabel-deskripsi">Deskripsi</label>
|
||||
<input type="text" class="form-control @error('deskripsi') is-invalid @enderror" id="add-tabel-deskripsi" name="deskripsi" placeholder="Cth: Deskripsi tabel pertanian" value="{{ old('deskripsi', $tabel->deskripsi) }}" />
|
||||
@error('deskripsi')<div class="error invalid-feedback">{{ $message }}</div>@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-4 text-end">
|
||||
<a href="{{ route('tabel.index') }}" class="btn btn-label-secondary me-2">Kembali</a>
|
||||
<button type="submit" class="btn btn-success data-submit">Simpan Tabel</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script>
|
||||
'use strict';
|
||||
$(document).ready(function () {
|
||||
|
||||
$('#add-tabel-group').select2();
|
||||
|
||||
$.validator.addMethod("snakecase", function(value, element) {
|
||||
return this.optional(element) || /^[a-z0-9]+(_[a-z0-9]+)*$/.test(value);
|
||||
}, "Gunakan format snake_case (huruf kecil dan underscore)");
|
||||
|
||||
$('#addUpdateTabelForm').validate({
|
||||
rules: {
|
||||
tabel: { required: true, snakecase: true },
|
||||
label: { required: true },
|
||||
menu: { required: true }
|
||||
},
|
||||
messages: {
|
||||
tabel: { required: "Nama tabel wajib diisi", snakecase: "Gunakan format snake_case (huruf kecil dan underscore)" },
|
||||
label: { required: "Label wajib diisi" },
|
||||
menu: { required: "Judul menu wajib diisi" }
|
||||
},
|
||||
errorElement: 'div',
|
||||
errorPlacement: function (error, element) {
|
||||
error.addClass('invalid-feedback');
|
||||
element.closest('.mb-6, .form-control-validation').append(error);
|
||||
},
|
||||
highlight: function (element) {
|
||||
$(element).addClass('is-invalid');
|
||||
},
|
||||
unhighlight: function (element) {
|
||||
$(element).removeClass('is-invalid');
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
@@ -0,0 +1,155 @@
|
||||
@extends('layout.main')
|
||||
|
||||
@section('content')
|
||||
<div class="container-xxl flex-grow-1 container-p-y">
|
||||
<div class="card">
|
||||
<div class="card-body border-bottom">
|
||||
<form method="GET" action="{{ route('tabel.index') }}" class="d-flex justify-content-between align-items-center row gap-3 gap-md-0">
|
||||
<div class="col-md-auto">
|
||||
<div class="d-flex align-items-center">
|
||||
<label class="me-2 text-nowrap">Show</label>
|
||||
<select name="per_page" class="form-select form-select-sm w-auto" onchange="this.form.submit()">
|
||||
<option value="10" {{ request('per_page') == 10 ? 'selected' : '' }}>10</option>
|
||||
<option value="25" {{ request('per_page') == 25 ? 'selected' : '' }}>25</option>
|
||||
<option value="50" {{ request('per_page') == 50 ? 'selected' : '' }}>50</option>
|
||||
</select>
|
||||
<label class="ms-2 text-nowrap">entries</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-auto d-flex gap-2">
|
||||
<div class="input-group input-group-sm w-auto">
|
||||
<input type="text" name="search" class="form-control" placeholder="Cari Nama Tabel..." value="{{ request('search') }}">
|
||||
<button type="submit" class="btn btn-outline-primary"><i class="ti tabler-search"></i></button>
|
||||
</div>
|
||||
<a href="{{ route('tabel.create') }}" class="btn btn-sm btn-primary">
|
||||
<i class="ti tabler-plus me-1"></i> Tambah
|
||||
</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="table-responsive text-nowrap">
|
||||
<table class="table table-hover">
|
||||
<thead class="border-top">
|
||||
<tr>
|
||||
<th>No</th>
|
||||
<th>Nama Tabel</th>
|
||||
<th>Label</th>
|
||||
<th>Menu</th>
|
||||
<th>Kelompok</th>
|
||||
<th>Aksi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@forelse($tabel as $index => $tbl)
|
||||
<tr>
|
||||
<td>{{ $loop->iteration }}</td>
|
||||
<td><span class="text-heading">{{ $tbl->tabel }}</span></td>
|
||||
<td><span class="text-muted">{{ $tbl->label }}</span></td>
|
||||
<td><span class="text-muted">{{ $tbl->menu }}</span></td>
|
||||
<td><span class="text-muted">{{ $tbl->group?->group }}</span></td>
|
||||
<td>
|
||||
<div class="d-flex align-items-center">
|
||||
@if (!$loop->first)
|
||||
<button type="button"
|
||||
class="btn btn-icon btn-text-secondary move-up"
|
||||
data-id="{{ $tbl->id }}">
|
||||
<i class="ti tabler-arrow-up"></i>
|
||||
</button>
|
||||
@endif
|
||||
@if (!$loop->last)
|
||||
<button type="button"
|
||||
class="btn btn-icon btn-text-secondary move-down"
|
||||
data-id="{{ $tbl->id }}">
|
||||
<i class="ti tabler-arrow-down"></i>
|
||||
</button>
|
||||
@endif
|
||||
<a href="{{ route('tabel.edit', $tbl->id) }}" class="btn btn-icon btn-text-secondary rounded-pill edit-record"><i class="ti tabler-edit ti-md"></i></a>
|
||||
<a href="javascript:;" class="btn btn-icon btn-text-secondary rounded-pill delete-record" data-id="{{ $tbl->id }}" data-nama="{{ $tbl->nama }}"><i class="ti tabler-trash ti-md"></i></a>
|
||||
<a href="{{ route('tabel.show', $tbl->id) }}" class="btn btn-icon btn-text-secondary rounded-pill view-record"><i class="ti tabler-eye ti-md"></i></a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="6" class="text-center py-4">Tidak ada data ditemukan.</td>
|
||||
</tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="card-footer d-flex justify-content-center justify-content-md-end border-top">
|
||||
{{ $tabel->appends(request()->query())->links('pagination::bootstrap-5') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script>
|
||||
'use strict';
|
||||
|
||||
$(document).ready(function () {
|
||||
|
||||
$(".move-up").click(function (e) {
|
||||
e.preventDefault();
|
||||
let id = $(this).data('id');
|
||||
|
||||
$.post("{{ route('tabel.move-up', ':id') }}".replace(':id', id), {
|
||||
_token: '{{ csrf_token() }}',
|
||||
_method: 'PUT'
|
||||
}, function (res) {
|
||||
if (res.status === 'success') {
|
||||
location.reload();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$(".move-down").click(function (e) {
|
||||
e.preventDefault();
|
||||
let id = $(this).data('id');
|
||||
|
||||
$.post("{{ route('tabel.move-down', ':id') }}".replace(':id', id), {
|
||||
_token: '{{ csrf_token() }}',
|
||||
_method: 'PUT'
|
||||
}, function (res) {
|
||||
if (res.status === 'success') {
|
||||
location.reload();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$(".delete-record").click(function (e) {
|
||||
e.preventDefault();
|
||||
const id = $(this).data('id');
|
||||
const name = $(this).data('nama');
|
||||
|
||||
Swal.fire({
|
||||
title: 'Hapus?',
|
||||
text: `Kolom ${name} akan dihapus!`,
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Ya, Hapus!',
|
||||
customClass: { confirmButton: 'btn btn-danger me-3', cancelButton: 'btn btn-label-secondary' },
|
||||
buttonsStyling: false
|
||||
}).then(function (result) {
|
||||
if (result.value) {
|
||||
$.ajax({
|
||||
url: "{{ route('tabel.destroy', ':id') }}".replace(':id', id),
|
||||
type: 'POST',
|
||||
data: {
|
||||
_token: '{{ csrf_token() }}',
|
||||
_method: 'DELETE'
|
||||
},
|
||||
success: function () {
|
||||
Swal.fire({ icon: 'success', title: 'Terhapus!', showConfirmButton: false, timer: 1500 })
|
||||
.then(() => location.reload());
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
@@ -0,0 +1,173 @@
|
||||
@extends('layout.main')
|
||||
|
||||
@section('content')
|
||||
<div class="container-xxl flex-grow-1 container-p-y">
|
||||
<div class="card">
|
||||
<div class="card-header border-bottom mb-4">
|
||||
<h5 class="card-title mb-0">Lihat Data Tabel</h5>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<form id="addViewTabelForm" >
|
||||
|
||||
<h6 class="mb-3">Informasi Tabel</h6>
|
||||
<div class="row">
|
||||
<div class="col-md-3 mb-4 form-control-validation">
|
||||
<label class="form-label" for="add-tabel-nama">Nama Tabel</label>
|
||||
<input type="text" class="form-control" id="add-tabel-nama" name="tabel" placeholder="Cth: Tabel Pertanian" value="{{ $tabel->tabel }}" readonly />
|
||||
</div>
|
||||
<div class="col-md-3 mb-4 form-control-validation">
|
||||
<label class="form-label" for="add-tabel-label">Label</label>
|
||||
<input type="text" class="form-control" id="add-tabel-label" name="label" placeholder="Cth: budi@email.com" value="{{ $tabel->label }}" readonly />
|
||||
</div>
|
||||
<div class="col-md-3 mb-4 form-control-validation">
|
||||
<label class="form-label" for="add-tabel-menu">Judul Menu</label>
|
||||
<input type="text" class="form-control" id="add-tabel-menu" name="menu" placeholder="Cth: Pertanian" value="{{ $tabel->menu }}" readonly />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12 mb-4 form-control-validation">
|
||||
<label class="form-label" for="add-tabel-deskripsi">Deskripsi</label>
|
||||
<input type="text" class="form-control" id="add-tabel-deskripsi" name="deskripsi" placeholder="Cth: Deskripsi tabel pertanian" value="{{ $tabel->deskripsi }}" readonly />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h6 class="mb-3">Informasi Kolom-Kolom</h6>
|
||||
|
||||
<hr class="my-4 mx-n4" />
|
||||
<div class="row mb-4">
|
||||
<div class="col-md-auto d-flex gap-2">
|
||||
<button type="button" class="btn btn-sm btn-primary" data-bs-toggle="offcanvas" data-bs-target="#offcanvasAddKolom" >
|
||||
<i class="ti tabler-plus me-1"></i> Tambah
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-4">
|
||||
<div class="col-md-12 mb-4 form-control-validation">
|
||||
|
||||
<div class="table-responsive text-nowrap mb-4">
|
||||
<table class="table table-hover">
|
||||
<thead class="border-top">
|
||||
<tr>
|
||||
<th>No</th>
|
||||
<th>Nama Kolom</th>
|
||||
<th>Label</th>
|
||||
<th>Jenis Data</th>
|
||||
<th>Aksi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@forelse($tabel->kolom as $index => $kolom)
|
||||
<tr>
|
||||
<td>{{ $loop->iteration }}</td>
|
||||
<td><span class="text-heading">{{ $kolom->kolom }}</span></td>
|
||||
<td><span class="text-muted">{{ $kolom->label }}</span></td>
|
||||
<td><span class="text-muted">{{ $kolom->tipe }}</span></td>
|
||||
<td>
|
||||
<div class="d-flex align-items-center">
|
||||
@if (!$loop->first)
|
||||
<button type="button"
|
||||
class="btn btn-icon btn-text-secondary move-up"
|
||||
data-id="{{ $kolom->id }}">
|
||||
<i class="ti tabler-arrow-up"></i>
|
||||
</button>
|
||||
@endif
|
||||
@if (!$loop->last)
|
||||
<button type="button"
|
||||
class="btn btn-icon btn-text-secondary move-down"
|
||||
data-id="{{ $kolom->id }}">
|
||||
<i class="ti tabler-arrow-down"></i>
|
||||
</button>
|
||||
@endif
|
||||
<a href="javascript:;" class="btn btn-icon btn-text-secondary rounded-pill edit-record" data-id="{{ $kolom->id }}"><i class="ti tabler-edit ti-md"></i></a>
|
||||
<a href="javascript:;" class="btn btn-icon btn-text-secondary rounded-pill delete-record" data-id="{{ $kolom->id }}" data-nama="{{ $kolom->nama }}"><i class="ti tabler-trash ti-md"></i></a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="5" class="text-center py-4">Tidak ada kolom ditemukan.</td>
|
||||
</tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-4 text-end">
|
||||
<a href="{{ route('tabel.index') }}" class="btn btn-label-secondary me-2">Kembali</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@include('ekosistem.kolom-basis-data.add')
|
||||
@include('ekosistem.kolom-basis-data.edit')
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script>
|
||||
'use strict';
|
||||
$(document).ready(function () {
|
||||
$(".move-up").click(function (e) {
|
||||
e.preventDefault();
|
||||
let id = $(this).data('id');
|
||||
|
||||
$.post("{{ route('tabel.kolom.move-up', [$tabel->id, ':id']) }}".replace(':id', id), {
|
||||
_token: '{{ csrf_token() }}',
|
||||
_method: 'PUT'
|
||||
}, function (res) {
|
||||
if (res.status === 'success') {
|
||||
location.reload();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$(".move-down").click(function (e) {
|
||||
e.preventDefault();
|
||||
let id = $(this).data('id');
|
||||
|
||||
$.post("{{ route('tabel.kolom.move-down', [$tabel->id, ':id']) }}".replace(':id', id), {
|
||||
_token: '{{ csrf_token() }}',
|
||||
_method: 'PUT'
|
||||
}, function (res) {
|
||||
if (res.status === 'success') {
|
||||
location.reload();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$(".delete-record").click(function (e) {
|
||||
e.preventDefault();
|
||||
const id = $(this).data('id');
|
||||
const name = $(this).data('nama');
|
||||
|
||||
Swal.fire({
|
||||
title: 'Hapus?',
|
||||
text: `Kolom ${name} akan dihapus!`,
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Ya, Hapus!',
|
||||
customClass: { confirmButton: 'btn btn-danger me-3', cancelButton: 'btn btn-label-secondary' },
|
||||
buttonsStyling: false
|
||||
}).then(function (result) {
|
||||
if (result.value) {
|
||||
$.ajax({
|
||||
url: "{{ route('tabel.kolom.destroy', [$tabel->id, ':id']) }}".replace(':id', id),
|
||||
type: 'DELETE',
|
||||
data: {
|
||||
_token: '{{ csrf_token() }}'
|
||||
},
|
||||
success: function () {
|
||||
Swal.fire({ icon: 'success', title: 'Terhapus!', showConfirmButton: false, timer: 1500 })
|
||||
.then(() => window.location.reload());
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
Reference in New Issue
Block a user