diff --git a/app/Contracts/Repositories/StudentRepository.php b/app/Contracts/Repositories/StudentRepository.php index eddc7186..f4a8ad0a 100644 --- a/app/Contracts/Repositories/StudentRepository.php +++ b/app/Contracts/Repositories/StudentRepository.php @@ -46,4 +46,9 @@ public function whereSchool(mixed $id): mixed { return $this->model->query()->where('school_id', $id)->latest()->paginate(10); } + + public function doesntHaveClassroom(): mixed + { + return $this->model-> + } } diff --git a/app/Http/Controllers/ClassroomController.php b/app/Http/Controllers/ClassroomController.php index 433471ff..45ff7d7c 100644 --- a/app/Http/Controllers/ClassroomController.php +++ b/app/Http/Controllers/ClassroomController.php @@ -65,7 +65,8 @@ public function store(StoreClassroomRequest $request) */ public function show(Classroom $classroom) { - return view('school.pages.class.detail-class', compact('classroom ')); + $schoolYears = $this->schoolYear->whereSchool(auth()->user()->school->id); + return view('school.pages.class.detail-class', compact('classroom', 'schoolYears')); } /** diff --git a/app/Models/Classroom.php b/app/Models/Classroom.php index 9a481354..a47e2dc0 100644 --- a/app/Models/Classroom.php +++ b/app/Models/Classroom.php @@ -19,4 +19,7 @@ class Classroom extends Model 'school_year_id', 'level_class_id' ]; + + public $incrementing = false; + public $keyType = 'char'; } diff --git a/resources/views/school/pages/class/detail-class.blade.php b/resources/views/school/pages/class/detail-class.blade.php index 9560cfde..380b6342 100644 --- a/resources/views/school/pages/class/detail-class.blade.php +++ b/resources/views/school/pages/class/detail-class.blade.php @@ -5,7 +5,11 @@
@@ -13,7 +17,7 @@
-

XII RPL 2

+

{{ $classroom->name }}

Pilih siswa di sebelah kiri untuk memasukkan siswa ke dalam Kelas

diff --git a/resources/views/school/pages/class/index.blade.php b/resources/views/school/pages/class/index.blade.php index e81bd2f2..41655fbd 100644 --- a/resources/views/school/pages/class/index.blade.php +++ b/resources/views/school/pages/class/index.blade.php @@ -214,8 +214,7 @@ class="icon icon-tabler icons-tabler-outline icon-tabler-users">
- Masuk Kelas + Masuk Kelas
diff --git a/routes/role/school.php b/routes/role/school.php index 07201105..a915c250 100644 --- a/routes/role/school.php +++ b/routes/role/school.php @@ -138,14 +138,10 @@ }); - - - - - - - - - - - +//kelas +Route::get('school/class', [ClassroomController::class, 'index'])->name('class.index'); +Route::post('school/add-class', [ClassroomController::class, 'store'])->name('class.store'); +Route::put('school/update-class/{classroom}', [ClassroomController::class, 'update'])->name('class.update'); +Route::delete('school/delete-class/{classroom}', [ClassroomController::class, 'destroy'])->name('class.delete'); +// detail kelas +Route::get('school/{classroom}', [ClassroomController::class, 'show'])->name('class.show');