From 035499a3b75dd5ec31b764640e29ee1857285d65 Mon Sep 17 00:00:00 2001 From: Xyuraa Date: Sat, 14 Dec 2024 03:54:50 +0700 Subject: [PATCH 1/9] yagitu --- .../Controllers/DashboardRplController.php | 44 +++++++++++++++++-- 1 file changed, 41 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/DashboardRplController.php b/app/Http/Controllers/DashboardRplController.php index 035447a..fca1cc1 100644 --- a/app/Http/Controllers/DashboardRplController.php +++ b/app/Http/Controllers/DashboardRplController.php @@ -14,7 +14,47 @@ public function index(Request $request) { $userId = Auth::id(); - // Jumlah data berdasarkan kategori + $totalWaktuLearning = Siswa::where('user_id', $userId) + ->where('kategori', 'Learning') + ->get() + ->reduce(function ($carry, $item) { + if ($item->waktu_mulai && $item->waktu_selesai) { + $waktuMulai = Carbon::parse($item->waktu_mulai); + $waktuSelesai = Carbon::parse($item->waktu_selesai); + if ($waktuSelesai->greaterThan($waktuMulai)) { + $carry += $waktuSelesai->diffInSeconds($waktuMulai); + } + } + return $carry; + }, 0); + + $siswaDataLearning = Siswa::where('user_id', $userId) + ->where('kategori', 'Learning') + ->get() + ->groupBy('materi_id') + ->map(function ($items, $materiId) use ($totalWaktuLearning) { + $totalTime = 0; + foreach ($items as $item) { + if ($item->waktu_mulai && $item->waktu_selesai) { + $waktuMulai = Carbon::parse($item->waktu_mulai); + $waktuSelesai = Carbon::parse($item->waktu_selesai); + if ($waktuSelesai->greaterThan($waktuMulai)) { + $totalTime += $waktuSelesai->diffInSeconds($waktuMulai); + } + } + } + $percentage = $totalWaktuLearning ? ($totalTime / $totalWaktuLearning) * 100 : 0; + return ['totalTime' => $totalTime, 'percentage' => $percentage]; + }); + + $materiNamesLearning = Materi::whereIn('id', $siswaDataLearning->keys())->pluck('materi', 'id'); + + $jumlahAktivitasLearning = Siswa::where('user_id', $userId) + ->where('kategori', 'Learning') + ->get() + ->groupBy('materi_id') + ->map->count(); + $jumlahDataProject = Siswa::where('user_id', $userId) ->where('kategori', 'Project') ->count(); @@ -23,7 +63,6 @@ public function index(Request $request) ->where('kategori', 'Learning') ->count(); - // Total waktu dalam detik $siswaData = Siswa::where('user_id', $userId) ->get() ->map(function ($item) { @@ -45,7 +84,6 @@ public function index(Request $request) $aktivitasNames = $siswaData->pluck('name'); $totalAktivitas = $jumlahDataLearning + $jumlahDataProject; - // Persentase $persentaseLearning = $totalAktivitas > 0 ? ($jumlahDataLearning / $totalAktivitas) * 100 : 0; $persentaseProject = $totalAktivitas > 0 ? ($jumlahDataProject / $totalAktivitas) * 100 : 0; From 82924dd3e51140058faac34c81f635498194b2ce Mon Sep 17 00:00:00 2001 From: Edy kurniawan Date: Mon, 16 Dec 2024 09:43:47 +0700 Subject: [PATCH 2/9] Create cd.yml --- .github/workflows/cd.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/cd.yml diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml new file mode 100644 index 0000000..d3143b1 --- /dev/null +++ b/.github/workflows/cd.yml @@ -0,0 +1,26 @@ +name: Laravel CD + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - name: executing remote ssh commands using password + uses: appleboy/ssh-action@master + with: + host: ${{ secrets.HOST }} + username: ${{ secrets.USERNAME }} + password: ${{ secrets.PASSWORD }} + port: ${{ secrets.PORT }} + script: | + cd /var/www/app-monitoring + git pull origin main + composer install --no-interaction --prefer-dist --optimize-autoloader + php artisan config:clear From b1d6b68524ec459a2043929cfc7aa914a7b37ad3 Mon Sep 17 00:00:00 2001 From: Edy kurniawan Date: Mon, 16 Dec 2024 09:44:25 +0700 Subject: [PATCH 3/9] Create ci_code_style.yml --- .github/workflows/ci_code_style.yml | 37 +++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/ci_code_style.yml diff --git a/.github/workflows/ci_code_style.yml b/.github/workflows/ci_code_style.yml new file mode 100644 index 0000000..bdfd7f8 --- /dev/null +++ b/.github/workflows/ci_code_style.yml @@ -0,0 +1,37 @@ +name: Fix Code Style + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + lint: + runs-on: ubuntu-latest + strategy: + fail-fast: true + matrix: + php: [8.3] + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + extensions: json, dom, curl, libxml, mbstring + coverage: none + + - name: Install Pint + run: composer global require laravel/pint + + - name: Run Pint + run: pint + + - name: Commit linted files + uses: stefanzweifel/git-auto-commit-action@v5 + with: + commit_message: "Fixes coding style" From be7530ab56b0bbeeca6cb2cd806d412c45103f4a Mon Sep 17 00:00:00 2001 From: edy-kurniawan Date: Mon, 16 Dec 2024 02:44:45 +0000 Subject: [PATCH 4/9] Fixes coding style --- app/Console/Kernel.php | 4 +- app/Http/Controllers/AktivitasController.php | 9 +++- .../Auth/ForgotPasswordController.php | 4 +- app/Http/Controllers/Auth/LoginController.php | 6 +-- .../Auth/ResetPasswordController.php | 3 +- .../DashboardPembimbingController.php | 51 +++++++++--------- .../Controllers/DashboardRplController.php | 6 +-- .../Controllers/DashboardSiswaController.php | 25 +++++---- .../Controllers/DetailSiswaController.php | 8 +-- app/Http/Controllers/JurusanController.php | 12 +++-- app/Http/Controllers/MateriController.php | 1 - app/Http/Controllers/MateriRplController.php | 19 +++---- app/Http/Controllers/MateriTkjController.php | 19 +++---- app/Http/Controllers/MonitoringController.php | 25 +++++---- app/Http/Controllers/ProfileController.php | 4 +- app/Http/Controllers/SiswaController.php | 19 +++---- app/Http/Controllers/SiswaRplController.php | 16 +++--- app/Http/Controllers/UserController.php | 2 +- .../Controllers/UserPembimbingController.php | 33 ++++++------ app/Http/Controllers/UserSiswaController.php | 19 +++---- app/Http/Middleware/RoleMiddleware.php | 2 - app/Models/Aktivitas.php | 2 + app/Models/Jurusan.php | 1 + app/Models/Materi.php | 2 +- app/Models/MateriTkj.php | 4 +- app/Models/Role.php | 3 +- app/Models/Siswa.php | 9 ++-- bootstrap/helpers.php | 15 +++--- .../2014_10_12_000000_create_users_table.php | 6 +-- .../2024_10_25_104737_create_materi_table.php | 2 +- database/seeders/DatabaseSeeder.php | 2 +- routes/web.php | 53 ++++++++----------- 32 files changed, 195 insertions(+), 191 deletions(-) diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index 101224b..9a9ad06 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -14,7 +14,7 @@ protected function schedule(Schedule $schedule) { $hour = config('app.hour'); $min = config('app.min'); - $scheduledInterval = $hour !== '' ? (($min !== '' && $min != 0) ? $min . ' */' . $hour . ' * * *' : '0 */' . $hour . ' * * *') : '*/' . $min . ' * * * *'; + $scheduledInterval = $hour !== '' ? (($min !== '' && $min != 0) ? $min.' */'.$hour.' * * *' : '0 */'.$hour.' * * *') : '*/'.$min.' * * * *'; if (config('app.is_demo')) { $schedule->command('migrate:fresh --seed')->cron($scheduledInterval); } @@ -25,7 +25,7 @@ protected function schedule(Schedule $schedule) */ protected function commands(): void { - $this->load(__DIR__ . '/Commands'); + $this->load(__DIR__.'/Commands'); require base_path('routes/console.php'); } diff --git a/app/Http/Controllers/AktivitasController.php b/app/Http/Controllers/AktivitasController.php index 487c85f..07b37c8 100644 --- a/app/Http/Controllers/AktivitasController.php +++ b/app/Http/Controllers/AktivitasController.php @@ -2,13 +2,15 @@ namespace App\Http\Controllers; -use Illuminate\Http\Request; use App\Models\Aktivitas; +use Illuminate\Http\Request; class AktivitasController extends Controller { - public function index() { + public function index() + { $aktivitas = Aktivitas::all(); + return view('pembimbing.aktivitas', compact('aktivitas')); } @@ -24,11 +26,14 @@ public function store(Request $request) return redirect()->route('aktivitas.index')->with('success', 'Aktivitas berhasil ditambahkan.'); } + public function edit($id) { $aktivitas = Aktivitas::findOrFail($id); + return view('pembimbing.edit_aktivitas', compact('aktivitas')); } + public function update(Request $request, $id) { $request->validate([ diff --git a/app/Http/Controllers/Auth/ForgotPasswordController.php b/app/Http/Controllers/Auth/ForgotPasswordController.php index 025e2d7..e765538 100644 --- a/app/Http/Controllers/Auth/ForgotPasswordController.php +++ b/app/Http/Controllers/Auth/ForgotPasswordController.php @@ -16,7 +16,7 @@ public function create() public function store(Request $request) { if (config('app.is_demo')) { - return back()->with('error', "You are in a demo version, resetting password is disabled."); + return back()->with('error', 'You are in a demo version, resetting password is disabled.'); } $request->validate([ @@ -33,6 +33,6 @@ public function store(Request $request) return $status == Password::RESET_LINK_SENT ? back()->with('status', __($status)) : back()->withInput($request->only('email')) - ->withErrors(['email' => __($status)]); + ->withErrors(['email' => __($status)]); } } diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.php index 8a05631..42a94ce 100644 --- a/app/Http/Controllers/Auth/LoginController.php +++ b/app/Http/Controllers/Auth/LoginController.php @@ -2,10 +2,10 @@ namespace App\Http\Controllers\Auth; -use Illuminate\Http\Request; -use Illuminate\Support\Facades\Auth; use App\Http\Controllers\Controller; use App\Models\User; +use Illuminate\Http\Request; +use Illuminate\Support\Facades\Auth; class LoginController extends Controller { @@ -45,13 +45,13 @@ public function store(Request $request) return back()->withErrors(['message' => 'Username atau password salah.'])->withInput($request->only('username')); } - public function destroy(Request $request) { Auth::logout(); $request->session()->invalidate(); $request->session()->regenerateToken(); + return redirect('/sign-in'); } } diff --git a/app/Http/Controllers/Auth/ResetPasswordController.php b/app/Http/Controllers/Auth/ResetPasswordController.php index 86e1cad..2d916b2 100644 --- a/app/Http/Controllers/Auth/ResetPasswordController.php +++ b/app/Http/Controllers/Auth/ResetPasswordController.php @@ -11,7 +11,6 @@ class ResetPasswordController extends Controller { - public function create(Request $request) { return view('auth.passrecover.reset-password', ['request' => $request]); @@ -46,6 +45,6 @@ function ($user) use ($request) { return $status == Password::PASSWORD_RESET ? redirect()->route('sign-in')->with('status', __($status)) : back()->withInput($request->only('email')) - ->withErrors(['email' => __($status)]); + ->withErrors(['email' => __($status)]); } } diff --git a/app/Http/Controllers/DashboardPembimbingController.php b/app/Http/Controllers/DashboardPembimbingController.php index a854e46..77196ca 100644 --- a/app/Http/Controllers/DashboardPembimbingController.php +++ b/app/Http/Controllers/DashboardPembimbingController.php @@ -1,10 +1,9 @@ [$rplCount, $tkjCount], 'backgroundColor' => ['#36A2EB', '#FF6384'], 'hoverOffset' => 15, - ] - ] + ], + ], ]; $activityData = Siswa::select('kategori') @@ -35,33 +34,33 @@ public function index() ->groupBy('kategori') ->pluck('total_waktu', 'kategori'); - $jumlahDataRPL = Siswa::where('user_id') + $jumlahDataRPL = Siswa::where('user_id') ->whereIn('kategori', ['Dikantor', 'Keluar Dengan Teknisi']) ->count(); - - $jumlahDataTKJ = Siswa::where('user_id') + $jumlahDataTKJ = Siswa::where('user_id') ->whereIn('kategori', ['Learning', 'Project']) ->count(); - - $totalWaktu = Siswa::where('user_id') - ->get() - ->reduce(function ($carry, $item) { - if ($item->waktu_mulai && $item->waktu_selesai) { - $waktuMulai = Carbon::parse($item->waktu_mulai); - $waktuSelesai = Carbon::parse($item->waktu_selesai); - if ($waktuSelesai->greaterThan($waktuMulai)) { - $carry += $waktuSelesai->diffInSeconds($waktuMulai); - } + + $totalWaktu = Siswa::where('user_id') + ->get() + ->reduce(function ($carry, $item) { + if ($item->waktu_mulai && $item->waktu_selesai) { + $waktuMulai = Carbon::parse($item->waktu_mulai); + $waktuSelesai = Carbon::parse($item->waktu_selesai); + if ($waktuSelesai->greaterThan($waktuMulai)) { + $carry += $waktuSelesai->diffInSeconds($waktuMulai); } - return $carry; - }, 0); - - $totalAktivitas = $jumlahDataTKJ + $jumlahDataRPL; - - $persentaseTKJ = $totalAktivitas > 0 ? ($jumlahDataTKJ / $totalAktivitas) * 100 : 0; - $persentaseRPL = $totalAktivitas > 0 ? ($jumlahDataRPL / $totalAktivitas) * 100 : 0; + } + + return $carry; + }, 0); + + $totalAktivitas = $jumlahDataTKJ + $jumlahDataRPL; + + $persentaseTKJ = $totalAktivitas > 0 ? ($jumlahDataTKJ / $totalAktivitas) * 100 : 0; + $persentaseRPL = $totalAktivitas > 0 ? ($jumlahDataRPL / $totalAktivitas) * 100 : 0; - return view('dashboard', compact('chartData', 'activityData', 'totalWaktuPerKategori', 'rplCount', 'tkjCount','jumlahDataRPL','jumlahDataTKJ','totalWaktu','persentaseTKJ','persentaseRPL')); + return view('dashboard', compact('chartData', 'activityData', 'totalWaktuPerKategori', 'rplCount', 'tkjCount', 'jumlahDataRPL', 'jumlahDataTKJ', 'totalWaktu', 'persentaseTKJ', 'persentaseRPL')); } } diff --git a/app/Http/Controllers/DashboardRplController.php b/app/Http/Controllers/DashboardRplController.php index 035447a..ccc95f2 100644 --- a/app/Http/Controllers/DashboardRplController.php +++ b/app/Http/Controllers/DashboardRplController.php @@ -2,10 +2,9 @@ namespace App\Http\Controllers; -use Illuminate\Http\Request; -use Carbon\Carbon; use App\Models\Siswa; -use App\Models\Materi; +use Carbon\Carbon; +use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; class DashboardRplController extends Controller @@ -35,6 +34,7 @@ public function index(Request $request) $totalTime = $waktuSelesai->diffInSeconds($waktuMulai); } } + return [ 'name' => $item->aktivitas_name, 'totalTime' => $totalTime, diff --git a/app/Http/Controllers/DashboardSiswaController.php b/app/Http/Controllers/DashboardSiswaController.php index 5d0166e..2117ca1 100644 --- a/app/Http/Controllers/DashboardSiswaController.php +++ b/app/Http/Controllers/DashboardSiswaController.php @@ -2,11 +2,11 @@ namespace App\Http\Controllers; -use Illuminate\Http\Request; -use Carbon\Carbon; -use App\Models\Siswa; use App\Models\Aktivitas; use App\Models\Materi; +use App\Models\Siswa; +use Carbon\Carbon; +use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; class DashboardSiswaController extends Controller @@ -26,6 +26,7 @@ public function index(Request $request) $carry += $waktuSelesai->diffInSeconds($waktuMulai); } } + return $carry; }, 0); @@ -45,6 +46,7 @@ public function index(Request $request) } } $percentage = $totalWaktuTeknisi ? ($totalTime / $totalWaktuTeknisi) * 100 : 0; + return ['totalTime' => $totalTime, 'percentage' => $percentage]; }); @@ -56,7 +58,7 @@ public function index(Request $request) ->groupBy('aktivitas_id') ->map->count(); - $totalWaktuDikantor = Siswa::where('user_id', $userId) + $totalWaktuDikantor = Siswa::where('user_id', $userId) ->where('kategori', 'DiKantor') ->get() ->reduce(function ($carry, $item) { @@ -67,6 +69,7 @@ public function index(Request $request) $carry += $waktuSelesai->diffInSeconds($waktuMulai); } } + return $carry; }, 0); @@ -86,6 +89,7 @@ public function index(Request $request) } } $percentage = $totalWaktuDikantor ? ($totalTime / $totalWaktuDikantor) * 100 : 0; + return ['totalTime' => $totalTime, 'percentage' => $percentage]; }); @@ -115,14 +119,15 @@ public function index(Request $request) $carry += $waktuSelesai->diffInSeconds($waktuMulai); } } + return $carry; }, 0); - $totalAktivitas = $jumlahDataDikantor + $jumlahDataTeknisi; + $totalAktivitas = $jumlahDataDikantor + $jumlahDataTeknisi; + + $persentaseDikantor = $totalAktivitas > 0 ? ($jumlahDataDikantor / $totalAktivitas) * 100 : 0; + $persentaseTeknisi = $totalAktivitas > 0 ? ($jumlahDataTeknisi / $totalAktivitas) * 100 : 0; - $persentaseDikantor = $totalAktivitas > 0 ? ($jumlahDataDikantor / $totalAktivitas) * 100 : 0; - $persentaseTeknisi = $totalAktivitas > 0 ? ($jumlahDataTeknisi / $totalAktivitas) * 100 : 0; - return view('dashboard_siswa', compact( 'siswaData', 'aktivitasNames', @@ -135,8 +140,8 @@ public function index(Request $request) 'jumlahDataDikantor', 'jumlahDataTeknisi', 'totalWaktu', - 'persentaseDikantor', + 'persentaseDikantor', 'persentaseTeknisi' )); } -} \ No newline at end of file +} diff --git a/app/Http/Controllers/DetailSiswaController.php b/app/Http/Controllers/DetailSiswaController.php index bbe6308..28fb9e8 100644 --- a/app/Http/Controllers/DetailSiswaController.php +++ b/app/Http/Controllers/DetailSiswaController.php @@ -2,11 +2,10 @@ namespace App\Http\Controllers; -use App\Models\Siswa; -use App\Models\Materi; use App\Models\Aktivitas; +use App\Models\Materi; +use App\Models\Siswa; use Carbon\Carbon; -use Illuminate\Http\Request; class DetailSiswaController extends Controller { @@ -14,13 +13,14 @@ public function index() { $totalMateri = Materi::count(); $totalAktivitas = Aktivitas::count(); - + $totalWaktu = Siswa::whereNotNull('waktu_mulai') ->whereNotNull('waktu_selesai') ->get() ->map(function ($siswa) { $waktuMulai = Carbon::parse($siswa->waktu_mulai); $waktuSelesai = Carbon::parse($siswa->waktu_selesai); + return $waktuSelesai->diffInMinutes($waktuMulai); }) ->sum(); diff --git a/app/Http/Controllers/JurusanController.php b/app/Http/Controllers/JurusanController.php index 67426e3..2c92c49 100644 --- a/app/Http/Controllers/JurusanController.php +++ b/app/Http/Controllers/JurusanController.php @@ -2,18 +2,20 @@ namespace App\Http\Controllers; -use Illuminate\Http\Request; -use App\Models\User; use App\Models\Jurusan; +use Illuminate\Http\Request; class JurusanController extends Controller { - public function index(){ + public function index() + { $jurusan = Jurusan::all(); - return view('admin.jurusan',compact('jurusan')); + + return view('admin.jurusan', compact('jurusan')); } - public function store(Request $request) { + public function store(Request $request) + { $request->validate([ 'jurusan' => 'required|max:255|unique:jurusan', ], [ diff --git a/app/Http/Controllers/MateriController.php b/app/Http/Controllers/MateriController.php index fb30c44..17101ee 100644 --- a/app/Http/Controllers/MateriController.php +++ b/app/Http/Controllers/MateriController.php @@ -2,7 +2,6 @@ namespace App\Http\Controllers; -use Illuminate\Http\Request; use App\Models\Materi; use Illuminate\Support\Facades\Auth; diff --git a/app/Http/Controllers/MateriRplController.php b/app/Http/Controllers/MateriRplController.php index d504d06..f146d22 100644 --- a/app/Http/Controllers/MateriRplController.php +++ b/app/Http/Controllers/MateriRplController.php @@ -2,17 +2,18 @@ namespace App\Http\Controllers; -use Illuminate\Http\Request; -use App\Models\MateriPembimbing; use App\Models\MateriTkj; +use Illuminate\Http\Request; use Illuminate\Support\Facades\Storage; + class MateriRplController extends Controller { - public function index(){ - $materirpl = MateriTkj::where('jurusan','RPL')->get(); - return view('pembimbing.materirpl',compact('materirpl')); - } + public function index() + { + $materirpl = MateriTkj::where('jurusan', 'RPL')->get(); + return view('pembimbing.materirpl', compact('materirpl')); + } public function store(Request $request) { @@ -20,7 +21,7 @@ public function store(Request $request) 'materi' => 'required|string|max:255', 'detail' => 'nullable|string', 'file_materi' => 'nullable|file|mimes:pdf,jpg,jpeg,png,doc,docx,xls,xlsx,ppt,pptx,txt|max:5120', - 'jurusan' => 'required|in:TKJ,RPL' + 'jurusan' => 'required|in:TKJ,RPL', ]); $filePath = null; @@ -37,7 +38,7 @@ public function store(Request $request) ]); return redirect()->back()->with('success', 'Materi berhasil upload'); - } + } public function update(Request $request, $id) { @@ -53,7 +54,7 @@ public function update(Request $request, $id) if ($materi->file_materi) { Storage::disk('public')->delete($materi->file_materi); } - + $originalFileName = $request->file('file_materi')->getClientOriginalName(); $filePath = $request->file('file_materi')->storeAs('materi_files', $originalFileName, 'public'); $materi->file_materi = $filePath; diff --git a/app/Http/Controllers/MateriTkjController.php b/app/Http/Controllers/MateriTkjController.php index 0032087..b7d5271 100644 --- a/app/Http/Controllers/MateriTkjController.php +++ b/app/Http/Controllers/MateriTkjController.php @@ -2,17 +2,18 @@ namespace App\Http\Controllers; -use Illuminate\Http\Request; -use App\Models\MateriPembimbing; use App\Models\MateriTkj; +use Illuminate\Http\Request; use Illuminate\Support\Facades\Storage; + class MateriTkjController extends Controller { - public function index(){ - $materitkj = MateriTkj::where('jurusan','TKJ')->get(); - return view('pembimbing.materi',compact('materitkj')); - } + public function index() + { + $materitkj = MateriTkj::where('jurusan', 'TKJ')->get(); + return view('pembimbing.materi', compact('materitkj')); + } public function store(Request $request) { @@ -20,7 +21,7 @@ public function store(Request $request) 'materi' => 'required|string|max:255', 'detail' => 'nullable|string', 'file_materi' => 'nullable|file|mimes:pdf,jpg,jpeg,png,doc,docx,xls,xlsx,ppt,pptx,txt|max:5120', - 'jurusan' => 'required|in:TKJ,RPL' + 'jurusan' => 'required|in:TKJ,RPL', ]); $filePath = null; @@ -37,7 +38,7 @@ public function store(Request $request) ]); return redirect()->back()->with('success', 'Materi berhasil upload'); - } + } public function update(Request $request, $id) { @@ -53,7 +54,7 @@ public function update(Request $request, $id) if ($materi->file_materi) { Storage::disk('public')->delete($materi->file_materi); } - + $originalFileName = $request->file('file_materi')->getClientOriginalName(); $filePath = $request->file('file_materi')->storeAs('materi_files', $originalFileName, 'public'); $materi->file_materi = $filePath; diff --git a/app/Http/Controllers/MonitoringController.php b/app/Http/Controllers/MonitoringController.php index 3d98225..eff6344 100644 --- a/app/Http/Controllers/MonitoringController.php +++ b/app/Http/Controllers/MonitoringController.php @@ -2,10 +2,10 @@ namespace App\Http\Controllers; -use Illuminate\Http\Request; -use App\Models\Siswa; use App\Models\materi; +use App\Models\Siswa; use App\Models\User; +use Illuminate\Http\Request; class MonitoringController extends Controller { @@ -46,31 +46,32 @@ public function index(Request $request) if ($search) { $monitoring->where(function ($query) use ($search) { - $query->where('kategori', 'like', '%' . $search . '%') - ->orWhere('report', 'like', '%' . $search . '%') - ->orWhere('waktu_mulai', 'like', '%' . $search . '%') - ->orWhere('waktu_selesai', 'like', '%' . $search . '%') - ->orWhere('status', 'like', '%' . $search . '%') + $query->where('kategori', 'like', '%'.$search.'%') + ->orWhere('report', 'like', '%'.$search.'%') + ->orWhere('waktu_mulai', 'like', '%'.$search.'%') + ->orWhere('waktu_selesai', 'like', '%'.$search.'%') + ->orWhere('status', 'like', '%'.$search.'%') ->orWhereHas('siswa_monitoring', function ($subQuery) use ($search) { - $subQuery->where('username', 'like', '%' . $search . '%') - ->orWhere('jurusan', 'like', '%' . $search . '%'); + $subQuery->where('username', 'like', '%'.$search.'%') + ->orWhere('jurusan', 'like', '%'.$search.'%'); }) ->orWhereHas('materitkj', function ($subQuery) use ($search) { - $subQuery->where('materi', 'like', '%' . $search . '%'); + $subQuery->where('materi', 'like', '%'.$search.'%'); }); }); } - $siswa_monitoring = User::all(); $materi_monitoring = Materi::all(); $monitoring = $monitoring->get(); return view('monitoring_siswa.monitoring', compact('monitoring', 'materi_monitoring', 'siswa_monitoring')); } + public function edit($id) { $siswa = Siswa::findOrFail($id); + return view('monitoring_siswa.monitoring', compact('siswa')); } @@ -78,6 +79,7 @@ public function update(Request $request, $id) { $siswa = Siswa::findOrFail($id); $siswa->update($request->all()); + return redirect()->route('monitoring.index')->with('success', 'Data siswa berhasil diperbarui.'); } @@ -85,6 +87,7 @@ public function destroy($id) { $siswa = Siswa::findOrFail($id); $siswa->delete(); + return redirect()->route('monitoring.index')->with('success', 'Data siswa berhasil dihapus.'); } } diff --git a/app/Http/Controllers/ProfileController.php b/app/Http/Controllers/ProfileController.php index 01fbb06..c6cd0d7 100644 --- a/app/Http/Controllers/ProfileController.php +++ b/app/Http/Controllers/ProfileController.php @@ -18,12 +18,12 @@ public function index() public function update(Request $request) { if (config('app.is_demo') && in_array(Auth::id(), [1])) { - return back()->with('error', "You are in a demo version. You are not allowed to change the email for default users."); + return back()->with('error', 'You are in a demo version. You are not allowed to change the email for default users.'); } $request->validate([ 'name' => 'required|min:3|max:255', - 'email' => 'required|email|max:255|unique:users,email,' . Auth::id(), + 'email' => 'required|email|max:255|unique:users,email,'.Auth::id(), 'location' => 'max:255', 'phone' => 'numeric|digits:10', 'about' => 'max:255', diff --git a/app/Http/Controllers/SiswaController.php b/app/Http/Controllers/SiswaController.php index 3f697ba..1e2fa06 100644 --- a/app/Http/Controllers/SiswaController.php +++ b/app/Http/Controllers/SiswaController.php @@ -2,11 +2,11 @@ namespace App\Http\Controllers; -use Illuminate\Http\Request; -use App\Models\Siswa; -use App\Models\Materi; use App\Models\Aktivitas; +use App\Models\Materi; +use App\Models\Siswa; use Carbon\Carbon; +use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; class SiswaController extends Controller @@ -31,12 +31,14 @@ public function index(Request $request) $item->total_waktu = '-'; } \Log::info("Item ID: {$item->id}, Waktu Mulai: {$item->waktu_mulai}"); + return $item; }); $aktivitas = Aktivitas::all(); $materitkj = Materi::where('jurusan', 'TKJ')->get(); - return view('monitoring_siswa.siswa', compact('siswa', 'materitkj','aktivitas','statusFilter')); + + return view('monitoring_siswa.siswa', compact('siswa', 'materitkj', 'aktivitas', 'statusFilter')); } public function updateTime(Request $request, $id) @@ -47,7 +49,7 @@ public function updateTime(Request $request, $id) 'waktu_selesai' => 'required|date_format:H:i', 'report' => 'required|string', 'bukti' => 'nullable|array', - 'bukti.*' => 'image|mimes:jpeg,png,jpg,gif,svg' + 'bukti.*' => 'image|mimes:jpeg,png,jpg,gif,svg', ]); $filePath = null; @@ -65,7 +67,7 @@ public function updateTime(Request $request, $id) } $currentDate = Carbon::parse($item->waktu_mulai)->format('Y-m-d'); - $newWaktuSelesai = $currentDate . ' ' . $request->waktu_selesai; + $newWaktuSelesai = $currentDate.' '.$request->waktu_selesai; $item->update([ 'waktu_selesai' => $newWaktuSelesai, @@ -123,7 +125,7 @@ public function updateAndCreate(Request $request, $id) $originalFileName = $file->getClientOriginalName(); $filePaths[] = $file->storeAs('bukti', $originalFileName, 'public'); } - $filePath = implode(',', $filePaths); + $filePath = implode(',', $filePaths); } $item->update([ @@ -142,7 +144,7 @@ public function updateAndCreate(Request $request, $id) return redirect()->route('siswa.index')->with('success', 'Data diperbarui dan entri baru berhasil ditambahkan.'); } - + public function start($id) { $siswa = Siswa::where('id', $id)->where('user_id', Auth::id())->firstOrFail(); @@ -214,5 +216,4 @@ public function update(Request $request, $id) return redirect()->route('siswa.index')->with('success', 'Laporan berhasil diperbarui.'); } - } diff --git a/app/Http/Controllers/SiswaRplController.php b/app/Http/Controllers/SiswaRplController.php index 61fb160..01efda1 100644 --- a/app/Http/Controllers/SiswaRplController.php +++ b/app/Http/Controllers/SiswaRplController.php @@ -2,11 +2,11 @@ namespace App\Http\Controllers; -use Illuminate\Http\Request; +use App\Models\Aktivitas; +use App\Models\Materi; use App\Models\Siswa; use Carbon\Carbon; -use App\Models\Materi; -use App\Models\Aktivitas; +use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; class SiswaRplController extends Controller @@ -31,15 +31,15 @@ public function index(Request $request) $item->total_waktu = '-'; } \Log::info("Item ID: {$item->id}, Waktu Mulai: {$item->waktu_mulai}"); + return $item; }); $aktivitasrpl = Aktivitas::all(); $materirpl = Materi::where('jurusan', 'RPL')->get(); - - return view('monitoring_siswa.siswarpl', compact('siswarpl', 'materirpl','aktivitasrpl','statusFilterrpl')); - } + return view('monitoring_siswa.siswarpl', compact('siswarpl', 'materirpl', 'aktivitasrpl', 'statusFilterrpl')); + } public function updateTime(Request $request, $id) { @@ -49,7 +49,7 @@ public function updateTime(Request $request, $id) 'waktu_selesai' => 'required|date_format:H:i', 'report' => 'required|string', 'bukti' => 'nullable|array', - 'bukti.*' => 'image|mimes:jpeg,png,jpg,gif,svg' + 'bukti.*' => 'image|mimes:jpeg,png,jpg,gif,svg', ]); $filePath = null; @@ -67,7 +67,7 @@ public function updateTime(Request $request, $id) } $currentDate = Carbon::parse($item->waktu_mulai)->format('Y-m-d'); - $newWaktuSelesai = $currentDate . ' ' . $request->waktu_selesai; + $newWaktuSelesai = $currentDate.' '.$request->waktu_selesai; $item->update([ 'waktu_selesai' => $newWaktuSelesai, diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php index f1e8ee1..a3ea7aa 100644 --- a/app/Http/Controllers/UserController.php +++ b/app/Http/Controllers/UserController.php @@ -3,13 +3,13 @@ namespace App\Http\Controllers; use App\Models\User; -use Illuminate\Http\Request; class UserController extends Controller { public function index() { $users = User::all(); + return view('laravel-examples.users-management', compact('users')); } } diff --git a/app/Http/Controllers/UserPembimbingController.php b/app/Http/Controllers/UserPembimbingController.php index d234589..c4306d8 100644 --- a/app/Http/Controllers/UserPembimbingController.php +++ b/app/Http/Controllers/UserPembimbingController.php @@ -2,14 +2,16 @@ namespace App\Http\Controllers; -use Illuminate\Http\Request; use App\Models\User; +use Illuminate\Http\Request; class UserPembimbingController extends Controller { - public function index(){ - $userpembimbing = User::where('role','pembimbing')->get(); - return view('admin.pembimbing',compact('userpembimbing')); + public function index() + { + $userpembimbing = User::where('role', 'pembimbing')->get(); + + return view('admin.pembimbing', compact('userpembimbing')); } public function store(Request $request) @@ -18,19 +20,19 @@ public function store(Request $request) 'username' => 'required|max:255|unique:users', 'password' => 'required|min:8|max:20', 'role' => 'required|in:admin,siswa,pembimbing', - 'status' => 'required|in:Aktif,Tidak Aktif' + 'status' => 'required|in:Aktif,Tidak Aktif', ], [ 'username.required' => 'Username Tidak Boleh Sama.', 'password.max' => 'Password Tidak Boleh Lebih Dari 20 Karakter.', 'password.min' => 'Password Tidak Boleh kurang dari 8 karakter', 'role.required' => 'Role is required', 'role.in' => 'Role harus salah satu dari:siswa, pembimbing', - 'status.required' => 'Status is required' + 'status.required' => 'Status is required', ]); $user = User::create([ 'username' => $request->username, - 'password' => $request->password, + 'password' => $request->password, 'role' => $request->role, 'status' => $request->status, ]); @@ -51,22 +53,22 @@ public function update(Request $request, $id) 'password.min' => 'Password Tidak Boleh kurang dari 8 karakter.', 'status.required' => 'Status is required', ]); - + $user = User::findOrFail($id); - + try { $user->username = $request->username; $user->password = $request->password; - $user->status = $request->status; + $user->status = $request->status; $user->save(); - + return redirect()->route('userpembimbing.index')->with('success', 'Data berhasil diperbarui.'); } catch (\Exception $e) { - return redirect()->route('userpembimbing.index')->with('error', 'Failed to update user: ' . $e->getMessage()); + return redirect()->route('userpembimbing.index')->with('error', 'Failed to update user: '.$e->getMessage()); } } - + public function destroy($id) { try { @@ -75,8 +77,7 @@ public function destroy($id) return redirect()->route('userpembimbing.index')->with('success', 'Data berhasil dihapus.'); } catch (\Exception $e) { - return redirect()->route('userpembimbing.index')->with('error', 'Data gagal dihapus: ' . $e->getMessage()); + return redirect()->route('userpembimbing.index')->with('error', 'Data gagal dihapus: '.$e->getMessage()); } } - -} \ No newline at end of file +} diff --git a/app/Http/Controllers/UserSiswaController.php b/app/Http/Controllers/UserSiswaController.php index 20552f1..2e63766 100644 --- a/app/Http/Controllers/UserSiswaController.php +++ b/app/Http/Controllers/UserSiswaController.php @@ -3,16 +3,17 @@ namespace App\Http\Controllers; use App\Models\User; -use Illuminate\Http\Request; use Carbon\Carbon; +use Illuminate\Http\Request; class UserSiswaController extends Controller { - public function index() { + public function index() + { $usersToUpdate = User::where('role', 'siswa') - ->where('status', 'Aktif') - ->where('tanggal_selesai', '<', Carbon::now()) - ->get(); + ->where('status', 'Aktif') + ->where('tanggal_selesai', '<', Carbon::now()) + ->get(); foreach ($usersToUpdate as $user) { $user->status = 'Tidak Aktif'; @@ -20,7 +21,7 @@ public function index() { } $usersiswa = User::where('role', 'siswa')->get(); - + return view('admin.siswa', compact('usersiswa')); } @@ -52,7 +53,7 @@ public function store(Request $request) $user = User::create([ 'username' => $request->username, - 'password' => $request->password, + 'password' => $request->password, 'role' => $request->role, 'status' => $request->status, 'tanggal_mulai' => $request->tanggal_mulai, @@ -102,7 +103,7 @@ public function update(Request $request, $id) return redirect()->route('usersiswa.index')->with('success', 'Data berhasil diperbarui.'); } catch (\Exception $e) { - return redirect()->route('usersiswa.index')->with('error', 'Data Gagal Diupdate' . $e->getMessage()); + return redirect()->route('usersiswa.index')->with('error', 'Data Gagal Diupdate'.$e->getMessage()); } } @@ -114,7 +115,7 @@ public function destroy($id) return redirect()->route('usersiswa.index')->with('success', 'Data berhasil dihapus.'); } catch (\Exception $e) { - return redirect()->route('usersiswa.index')->with('error', 'Data gagal dihapus: ' . $e->getMessage()); + return redirect()->route('usersiswa.index')->with('error', 'Data gagal dihapus: '.$e->getMessage()); } } } diff --git a/app/Http/Middleware/RoleMiddleware.php b/app/Http/Middleware/RoleMiddleware.php index 63a1ba6..245a52b 100644 --- a/app/Http/Middleware/RoleMiddleware.php +++ b/app/Http/Middleware/RoleMiddleware.php @@ -11,8 +11,6 @@ class RoleMiddleware /** * Handle an incoming request. * - * @param \Illuminate\Http\Request $request - * @param \Closure $next * @param mixed ...$roles * @return mixed */ diff --git a/app/Models/Aktivitas.php b/app/Models/Aktivitas.php index fa417d4..3229a02 100644 --- a/app/Models/Aktivitas.php +++ b/app/Models/Aktivitas.php @@ -8,7 +8,9 @@ class Aktivitas extends Model { use HasFactory; + protected $table = 'aktivitas'; + protected $fillable = [ 'nama_aktivitas', ]; diff --git a/app/Models/Jurusan.php b/app/Models/Jurusan.php index ae481b3..46ab308 100644 --- a/app/Models/Jurusan.php +++ b/app/Models/Jurusan.php @@ -10,6 +10,7 @@ class Jurusan extends Model use HasFactory; protected $table = 'jurusan'; + protected $fillable = [ 'jurusan', ]; diff --git a/app/Models/Materi.php b/app/Models/Materi.php index 966278e..79ae1c3 100644 --- a/app/Models/Materi.php +++ b/app/Models/Materi.php @@ -15,7 +15,7 @@ class Materi extends Model 'materi', 'detail', 'file_materi', - 'jurusan' + 'jurusan', ]; public function siswa() diff --git a/app/Models/MateriTkj.php b/app/Models/MateriTkj.php index e28e7fb..0e740ee 100644 --- a/app/Models/MateriTkj.php +++ b/app/Models/MateriTkj.php @@ -8,13 +8,13 @@ class MateriTkj extends Model { use HasFactory; - + protected $table = 'materi'; protected $fillable = [ 'materi', 'file_materi', 'detail', - 'jurusan' + 'jurusan', ]; } diff --git a/app/Models/Role.php b/app/Models/Role.php index 0703ed7..90d0234 100644 --- a/app/Models/Role.php +++ b/app/Models/Role.php @@ -10,7 +10,8 @@ class Role extends Model use HasFactory; protected $table = 'role'; + protected $fillable = [ - 'nama_role' + 'nama_role', ]; } diff --git a/app/Models/Siswa.php b/app/Models/Siswa.php index 27a2441..fd33add 100644 --- a/app/Models/Siswa.php +++ b/app/Models/Siswa.php @@ -4,7 +4,6 @@ use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; -use Carbon\Carbon; class siswa extends Model { @@ -21,12 +20,12 @@ class siswa extends Model 'materi_id', 'user_id', 'aktivitas_id', - 'bukti' + 'bukti', ]; protected $dates = [ 'waktu_mulai', - 'waktu_selesai' + 'waktu_selesai', ]; protected $casts = [ @@ -37,13 +36,12 @@ public function materitkj() { return $this->belongsTo(Materi::class, 'materi_id'); } - + public function aktivitas() { return $this->belongsTo(Aktivitas::class, 'aktivitas_id'); } - public function siswa_monitoring() { return $this->belongsTo(User::class, 'user_id'); @@ -53,5 +51,4 @@ public function materi() { return $this->belongsToMany(Materi::class, 'siswa_materi', 'siswa_id', 'materi_id'); } - } diff --git a/bootstrap/helpers.php b/bootstrap/helpers.php index e4800b9..ad5d319 100644 --- a/bootstrap/helpers.php +++ b/bootstrap/helpers.php @@ -5,7 +5,6 @@ function is_current_route($routeName) return request()->routeIs($routeName) ? 'active' : ''; } - function in_array_r($needle, $haystack, $strict = false) { foreach ($haystack as $item) { @@ -17,20 +16,20 @@ function in_array_r($needle, $haystack, $strict = false) return false; } - function getCategoriesArray($parent, $child = null) { - $categories = array( + $categories = [ 'dashboard', 'tables', 'wallet', 'RTL', - 'laravel-examples' => array( + 'laravel-examples' => [ 'user-profile', 'users-management', - ), - ); + ], + ]; - if ($child) + if ($child) { return $categories[$parent][$child]; - else + } else { return $categories[$parent]; + } } diff --git a/database/migrations/2014_10_12_000000_create_users_table.php b/database/migrations/2014_10_12_000000_create_users_table.php index 6ca83be..92f06eb 100644 --- a/database/migrations/2014_10_12_000000_create_users_table.php +++ b/database/migrations/2014_10_12_000000_create_users_table.php @@ -15,12 +15,12 @@ public function up(): void $table->id(); $table->string('username')->unique(); $table->string('password'); - $table->enum('role', ['pembimbing','siswa']); - $table->enum('status',['Aktif', 'Tidak Aktif']); + $table->enum('role', ['pembimbing', 'siswa']); + $table->enum('status', ['Aktif', 'Tidak Aktif']); $table->date('tanggal_mulai')->nullable(); $table->date('tanggal_selesai')->nullable(); $table->string('masa_pkl')->nullable(); - $table->enum('jurusan', ['TKJ','RPL'])->nullable(); + $table->enum('jurusan', ['TKJ', 'RPL'])->nullable(); $table->rememberToken(); $table->timestamps(); }); diff --git a/database/migrations/2024_10_25_104737_create_materi_table.php b/database/migrations/2024_10_25_104737_create_materi_table.php index 69bc5f8..9bfcbf2 100644 --- a/database/migrations/2024_10_25_104737_create_materi_table.php +++ b/database/migrations/2024_10_25_104737_create_materi_table.php @@ -16,7 +16,7 @@ public function up(): void $table->string('materi'); $table->text('detail'); $table->string('file_materi')->nullable(); - $table->enum('jurusan',['TKJ','RPL'])->nullable(); + $table->enum('jurusan', ['TKJ', 'RPL'])->nullable(); $table->timestamps(); }); } diff --git a/database/seeders/DatabaseSeeder.php b/database/seeders/DatabaseSeeder.php index 496d4f7..2b7bf97 100644 --- a/database/seeders/DatabaseSeeder.php +++ b/database/seeders/DatabaseSeeder.php @@ -15,7 +15,7 @@ public function run() 'name' => 'Alec Thompson', 'email' => 'admin@corporateui.com', 'password' => Hash::make('secret'), - 'about' => "Hi, I’m Alec Thompson, Decisions: If you can’t decide, the answer is no. If two equally difficult paths, choose the one more painful in the short term (pain avoidance is creating an illusion of equality).", + 'about' => 'Hi, I’m Alec Thompson, Decisions: If you can’t decide, the answer is no. If two equally difficult paths, choose the one more painful in the short term (pain avoidance is creating an illusion of equality).', ]); } } diff --git a/routes/web.php b/routes/web.php index ce65a9f..e8ac804 100644 --- a/routes/web.php +++ b/routes/web.php @@ -1,28 +1,25 @@ name('signup')->middleware('guest'); - Route::get('/sign-in', [LoginController::class, 'create']) ->middleware('guest') ->name('sign-in'); @@ -102,8 +98,6 @@ Route::put('/laravel-examples/user-profile/update', [ProfileController::class, 'update'])->name('users.update')->middleware('auth'); Route::get('/laravel-examples/users-management', [UserController::class, 'index'])->name('users-management')->middleware('auth'); - - Route::resource('materitkj', MateriTkjController::class)->middleware(['auth', 'role:pembimbing']); Route::middleware(['auth', 'role:siswa'])->group(function () { @@ -113,31 +107,26 @@ Route::resource('jurusan', JurusanController::class)->middleware(['auth', 'role:admin']); Route::resource('materi', MateriController::class)->middleware(['auth', 'role:siswa']); +Route::resource('detail', DetailSiswaController::class)->middleware(['auth', 'role:siswa']); +Route::resource('useradmin', UserPembimbingController::class)->middleware(['auth', 'role:pembimbing']); +Route::resource('userpembimbing', UserPembimbingController::class)->middleware(['auth', 'role:pembimbing']); +Route::resource('usersiswa', UserSiswaController::class)->middleware(['auth', 'role:pembimbing']); -Route::resource('detail',DetailSiswaController::class)->middleware(['auth','role:siswa']); -Route::resource('useradmin' , UserPembimbingController::class)->middleware(['auth', 'role:pembimbing']); -Route::resource('userpembimbing' , UserPembimbingController::class)->middleware(['auth', 'role:pembimbing']); -Route::resource('usersiswa' , UserSiswaController::class)->middleware(['auth', 'role:pembimbing']); - -Route::resource('monitoring', MonitoringController::class)->middleware(['auth', 'role:pembimbing']); - +Route::resource('monitoring', MonitoringController::class)->middleware(['auth', 'role:pembimbing']); Route::put('/siswarpl/{id}/updateTime', [SiswaRplController::class, 'updateTime'])->name('siswarpl.updateTime'); Route::put('/siswa/{id}/updateTime', [SiswaController::class, 'updateTime'])->name('siswa.updateTime'); - Route::resource('aktivitas', AktivitasController::class); Route::resource('materirpl', MateriRplController::class); -Route::resource('Dashboardsiswa', DashboardSiswaController::class); - - +Route::resource('Dashboardsiswa', DashboardSiswaController::class); -Route::resource('dashboardpembimbing',DashboardPembimbingController::class); -Route::resource('dashboardrpl',DashboardRplController::class); +Route::resource('dashboardpembimbing', DashboardPembimbingController::class); +Route::resource('dashboardrpl', DashboardRplController::class); Route::resource('dashboardsiswa', DashboardSiswaController::class); Route::post('/login', [LoginController::class, 'store'])->name('login.store'); Route::get('/dashboard-rpl', [DashboardRplController::class, 'index'])->name('dashboardrpl.index'); Route::post('/siswa/updateAndCreate/{id}', [SiswaController::class, 'updateAndCreate'])->name('siswa.updateAndCreate'); -Route::put('/siswa/{id}/update-create', [SiswaController::class, 'updateAndCreate'])->name('siswa.updateAndCreate'); \ No newline at end of file +Route::put('/siswa/{id}/update-create', [SiswaController::class, 'updateAndCreate'])->name('siswa.updateAndCreate'); From 005158ba068b43dac03d97955ca727aea09a84ce Mon Sep 17 00:00:00 2001 From: Xyuraa Date: Mon, 16 Dec 2024 09:51:21 +0700 Subject: [PATCH 5/9] bug --- app/Http/Controllers/MonitoringController.php | 2 +- .../views/monitoring_siswa/siswa.blade.php | 24 +------------------ 2 files changed, 2 insertions(+), 24 deletions(-) diff --git a/app/Http/Controllers/MonitoringController.php b/app/Http/Controllers/MonitoringController.php index 3d98225..2c63ed8 100644 --- a/app/Http/Controllers/MonitoringController.php +++ b/app/Http/Controllers/MonitoringController.php @@ -63,7 +63,7 @@ public function index(Request $request) $siswa_monitoring = User::all(); - $materi_monitoring = Materi::all(); + $materi_monitoring = materi::all(); $monitoring = $monitoring->get(); return view('monitoring_siswa.monitoring', compact('monitoring', 'materi_monitoring', 'siswa_monitoring')); diff --git a/resources/views/monitoring_siswa/siswa.blade.php b/resources/views/monitoring_siswa/siswa.blade.php index c371378..5af7602 100644 --- a/resources/views/monitoring_siswa/siswa.blade.php +++ b/resources/views/monitoring_siswa/siswa.blade.php @@ -442,7 +442,7 @@ class="btn btn-info">Simpan
@csrf -
Laporan 1
+
Silahkan inputkan laporan
-
- - -
Laporan 2
-
- - -
-