Update Master & APPService

This commit is contained in:
ahmadafriadi 2026-02-24 10:28:36 +07:00
parent 5891128b8e
commit 72d7b97939
7 changed files with 58 additions and 69 deletions

View File

@ -24,9 +24,9 @@ public function getKabupatenKota(Request $request)
$kabupatenKota = $kabupatenKotaQuery->get()->map(function($item) {
return [
'id' => $item->id,
'kode_kabupaten_kota' => $item->kode_kabupaten_kota,
'nama_kabupaten_kota' => $item->nama_kabupaten_kota,
'nama_provinsi' => $item->provinsi->nama_provinsi ?? '-',
'kode_kabupaten_kota' => $item->kode,
'nama_kabupaten_kota' => $item->nama,
'nama_provinsi' => $item->provinsi->nama ?? '-',
];
});

View File

@ -14,7 +14,24 @@ public function index()
public function getProvinsi()
{
$provinsi = Provinsi::select(['id', 'kode_provinsi', 'nama_provinsi', 'iso'])->get();
$provinsi = Provinsi::select(['id', 'kode', 'nama', 'iso'])->get();
return response()->json(['data' => $provinsi]);
}
public function store(Request $request)
{
$request->validate([
'kode' => 'required|unique:provinsi,kode',
'nama' => 'required|unique:provinsi,nama',
'iso' => 'required|unique:provinsi,iso',
]);
$provinsi = new Provinsi();
$provinsi->kode = $request->kode;
$provinsi->nama = $request->nama;
$provinsi->iso = $request->iso;
$provinsi->save();
return response()->json(['message' => 'Provinsi berhasil ditambahkan']);
}
}

View File

@ -27,7 +27,7 @@ public function boot(): void
URL::forceScheme('https');
}
Gate::define('super-admin', function (User $user) {
Gate::define('super_admin', function (User $user) {
return $user->role === Role::SUPER_ADMIN;
});

View File

@ -115,11 +115,11 @@ document.addEventListener('DOMContentLoaded', function (e) {
{
buttons: [
{
text: '<i class="ti tabler-plus me-0 me-sm-1 ti-xs"></i><span class="d-none d-sm-inline-block">Add New User</span>',
text: '<i class="ti tabler-plus me-0 me-sm-1 ti-xs"></i><span class="d-none d-sm-inline-block">Tambah Kabupaten/Kota</span>',
className: 'add-new btn btn-primary ms-2 waves-effect waves-light',
attr: {
'data-bs-toggle': 'offcanvas',
'data-bs-target': '#offcanvasAddUser'
'data-bs-target': '#offcanvasAddKabupatenKota'
}
}
]

View File

@ -36,7 +36,7 @@ document.addEventListener('DOMContentLoaded', function (e) {
columns: [
{ data: 'id' },
{ data: 'id' },
{ data: 'kode_provinsi' },
{ data: 'kode' },
{ data: 'nama' },
{ data: 'iso' }
],
@ -61,13 +61,13 @@ document.addEventListener('DOMContentLoaded', function (e) {
{
targets: 2,
render: function (data, type, full, meta) {
return '<span class="text-truncate d-flex align-items-center text-heading">' + full['kode_provinsi'] + '</span>';
return '<span class="text-truncate d-flex align-items-center text-heading">' + full['kode'] + '</span>';
}
},
{
targets: 3,
render: function (data, type, full, meta) {
var name = full['nama_provinsi'], iso = full['iso'];
var name = full['nama'], iso = full['iso'];
var stateNum = Math.floor(Math.random() * 6);
var states = ['success', 'danger', 'warning', 'info', 'primary', 'secondary'];
var state = states[stateNum];
@ -125,11 +125,11 @@ document.addEventListener('DOMContentLoaded', function (e) {
{
buttons: [
{
text: '<i class="ti tabler-plus me-0 me-sm-1 ti-xs"></i><span class="d-none d-sm-inline-block">Add New User</span>',
text: '<i class="ti tabler-plus me-0 me-sm-1 ti-xs"></i><span class="d-none d-sm-inline-block">Add New Provinsi</span>',
className: 'add-new btn btn-primary ms-2 waves-effect waves-light',
attr: {
'data-bs-toggle': 'offcanvas',
'data-bs-target': '#offcanvasAddUser'
'data-bs-target': '#offcanvasAddProvinsi'
}
}
]

View File

@ -4,40 +4,26 @@
<div class="card-body">
<!-- Logo -->
<div class="app-brand justify-content-center mb-6">
<a href="index.html" class="app-brand-link">
<a href="{{ route('dashboard.summary') }}" class="app-brand-link">
<span class="app-brand-logo demo">
<span class="text-primary">
<svg width="32" height="22" viewBox="0 0 32 22" fill="none" xmlns="http://www.w3.org/2000/svg">
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M0.00172773 0V6.85398C0.00172773 6.85398 -0.133178 9.01207 1.98092 10.8388L13.6912 21.9964L19.7809 21.9181L18.8042 9.88248L16.4951 7.17289L9.23799 0H0.00172773Z"
fill="currentColor" />
<path
opacity="0.06"
fill-rule="evenodd"
clip-rule="evenodd"
d="M7.69824 16.4364L12.5199 3.23696L16.5541 7.25596L7.69824 16.4364Z"
fill="#161616" />
<path
opacity="0.06"
fill-rule="evenodd"
clip-rule="evenodd"
d="M8.07751 15.9175L13.9419 4.63989L16.5849 7.28475L8.07751 15.9175Z"
fill="#161616" />
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M7.77295 16.3566L23.6563 0H32V6.88383C32 6.88383 31.8262 9.17836 30.6591 10.4057L19.7824 22H13.6938L7.77295 16.3566Z"
fill="currentColor" />
</svg>
<span class="text-primary">
<svg width="32" height="24" viewBox="0 0 32 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<!-- Daun Bagian Kiri -->
<path opacity="0.3" d="M16 2.5C16 2.5 5 6.5 5 15.5C5 20.5 11 23.5 16 23.5V2.5Z" fill="currentColor" />
<!-- Daun Bagian Kanan -->
<path opacity="0.6" d="M16 2.5C16 2.5 27 6.5 27 15.5C27 20.5 21 23.5 16 23.5V2.5Z" fill="currentColor" />
<!-- Grafik Pertumbuhan (Monev) -->
<path d="M2 19L10 11L15 15L27 4" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" />
<!-- Titik Target/Pencapaian -->
<circle cx="27" cy="4" r="2.5" fill="currentColor" />
</svg>
</span>
</span>
</span>
<span class="app-brand-text demo text-heading fw-bold">Vuexy</span>
<span class="app-brand-text demo menu-text fw-bold ms-3" style="text-transform: capitalize;">AgroMonev</span>
</a>
</div>
<!-- /Logo -->
<h4 class="mb-1">Welcome to Vuexy! 👋</h4>
<h4 class="mb-1">Welcome to AgroMonev! 👋</h4>
<p class="mb-6">Please sign-in to your account and start the adventure</p>
@if ($errors->any())
<div class="alert alert-danger">

View File

@ -4,36 +4,22 @@
<div class="card-body">
<!-- Logo -->
<div class="app-brand justify-content-center mb-6">
<a href="index.html" class="app-brand-link">
<a href="{{ route('dashboard.summary') }}" class="app-brand-link">
<span class="app-brand-logo demo">
<span class="text-primary">
<svg width="32" height="22" viewBox="0 0 32 22" fill="none" xmlns="http://www.w3.org/2000/svg">
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M0.00172773 0V6.85398C0.00172773 6.85398 -0.133178 9.01207 1.98092 10.8388L13.6912 21.9964L19.7809 21.9181L18.8042 9.88248L16.4951 7.17289L9.23799 0H0.00172773Z"
fill="currentColor" />
<path
opacity="0.06"
fill-rule="evenodd"
clip-rule="evenodd"
d="M7.69824 16.4364L12.5199 3.23696L16.5541 7.25596L7.69824 16.4364Z"
fill="#161616" />
<path
opacity="0.06"
fill-rule="evenodd"
clip-rule="evenodd"
d="M8.07751 15.9175L13.9419 4.63989L16.5849 7.28475L8.07751 15.9175Z"
fill="#161616" />
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M7.77295 16.3566L23.6563 0H32V6.88383C32 6.88383 31.8262 9.17836 30.6591 10.4057L19.7824 22H13.6938L7.77295 16.3566Z"
fill="currentColor" />
</svg>
<span class="text-primary">
<svg width="32" height="24" viewBox="0 0 32 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<!-- Daun Bagian Kiri -->
<path opacity="0.3" d="M16 2.5C16 2.5 5 6.5 5 15.5C5 20.5 11 23.5 16 23.5V2.5Z" fill="currentColor" />
<!-- Daun Bagian Kanan -->
<path opacity="0.6" d="M16 2.5C16 2.5 27 6.5 27 15.5C27 20.5 21 23.5 16 23.5V2.5Z" fill="currentColor" />
<!-- Grafik Pertumbuhan (Monev) -->
<path d="M2 19L10 11L15 15L27 4" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" />
<!-- Titik Target/Pencapaian -->
<circle cx="27" cy="4" r="2.5" fill="currentColor" />
</svg>
</span>
</span>
</span>
<span class="app-brand-text demo text-heading fw-bold">Vuexy</span>
<span class="app-brand-text demo menu-text fw-bold ms-3" style="text-transform: capitalize;">AgroMonev</span>
</a>
</div>
<!-- /Logo -->