diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index f0052b4..ee04593 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -57,4 +57,7 @@ class HomeController extends Controller 'msg' => 'Pengaturan diubah' ]); } + + //TODO: dump sql all data + //TODO: reset all data } diff --git a/app/Http/Controllers/TagihanController.php b/app/Http/Controllers/TagihanController.php index 7f8b244..e0a7f1d 100644 --- a/app/Http/Controllers/TagihanController.php +++ b/app/Http/Controllers/TagihanController.php @@ -157,8 +157,20 @@ class TagihanController extends Controller * @param int $id * @return \Illuminate\Http\Response */ - public function destroy($id) + public function destroy(Tagihan $tagihan) { - //TODO: work on this if transaksi and keuangan done + if($tagihan->transaksi->count() != 0){ + return redirect()->route('tagihan.index')->with([ + 'type' => 'danger', + 'msg' => 'tidak dapat menghapus tagihan yang masih memiliki transaksi' + ]); + } + $tagihan->siswa()->detach(); + if($tagihan->delete()){ + return redirect()->route('tagihan.index')->with([ + 'type' => 'success', + 'msg' => 'tagihan telah dihapus' + ]); + } } } diff --git a/resources/views/dashboard/index.blade.php b/resources/views/dashboard/index.blade.php index 18f4579..69f5f62 100644 --- a/resources/views/dashboard/index.blade.php +++ b/resources/views/dashboard/index.blade.php @@ -1,7 +1,6 @@ @extends('layouts.app') -@section('site-name','Sistem Informasi SPP') -@section('page-name','PAUD') +@section('page-name','Dashboard') @section('content')
Nama Aplikasi : {{ $pengaturan->nama }}
Logo :
+