set modules
This commit is contained in:
parent
876c896478
commit
b3423db9d7
|
|
@ -8,17 +8,27 @@ use Illuminate\Support\Facades\Storage;
|
||||||
|
|
||||||
class adminmycoursesController extends Controller
|
class adminmycoursesController extends Controller
|
||||||
{
|
{
|
||||||
|
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
if (!session()->has('admin_id')) {
|
if (!session()->has('admin_id')) {
|
||||||
return redirect('/adminlogin')->with('error', 'Please login first!');
|
return redirect('/admin/login')->with('error', 'Please login first!');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Fetch courses and manually attach modules to each course object
|
||||||
$courses = DB::table('courses')->orderBy('id', 'desc')->get();
|
$courses = DB::table('courses')->orderBy('id', 'desc')->get();
|
||||||
|
|
||||||
|
foreach ($courses as $course) {
|
||||||
|
$course->modules = DB::table('course_modules')
|
||||||
|
->where('course_id', $course->id)
|
||||||
|
->orderBy('semester', 'asc')
|
||||||
|
->orderBy('id', 'asc')
|
||||||
|
->get();
|
||||||
|
}
|
||||||
|
|
||||||
return view('admin.adminmycourses', compact('courses'));
|
return view('admin.adminmycourses', compact('courses'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// --- COURSE CRUD METHODS ---
|
||||||
|
|
||||||
public function store(Request $request)
|
public function store(Request $request)
|
||||||
{
|
{
|
||||||
|
|
@ -58,7 +68,6 @@ class adminmycoursesController extends Controller
|
||||||
return redirect()->back()->with('success', 'Course added successfully!');
|
return redirect()->back()->with('success', 'Course added successfully!');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function update(Request $request, $id)
|
public function update(Request $request, $id)
|
||||||
{
|
{
|
||||||
$request->validate([
|
$request->validate([
|
||||||
|
|
@ -101,18 +110,17 @@ class adminmycoursesController extends Controller
|
||||||
return redirect()->back()->with('success', 'Course updated successfully!');
|
return redirect()->back()->with('success', 'Course updated successfully!');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function destroy($id)
|
public function destroy($id)
|
||||||
{
|
{
|
||||||
$course = DB::table('courses')->where('id', $id)->first();
|
$course = DB::table('courses')->where('id', $id)->first();
|
||||||
|
|
||||||
if ($course) {
|
if ($course) {
|
||||||
|
|
||||||
if ($course->image && Storage::disk('public')->exists($course->image)) {
|
if ($course->image && Storage::disk('public')->exists($course->image)) {
|
||||||
Storage::disk('public')->delete($course->image);
|
Storage::disk('public')->delete($course->image);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Clean up related modules
|
||||||
|
DB::table('course_modules')->where('course_id', $id)->delete();
|
||||||
DB::table('courses')->where('id', $id)->delete();
|
DB::table('courses')->where('id', $id)->delete();
|
||||||
|
|
||||||
return redirect()->back()->with('success', 'Course deleted successfully!');
|
return redirect()->back()->with('success', 'Course deleted successfully!');
|
||||||
|
|
@ -120,4 +128,59 @@ class adminmycoursesController extends Controller
|
||||||
|
|
||||||
return redirect()->back()->with('error', 'Course not found!');
|
return redirect()->back()->with('error', 'Course not found!');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// --- MODULE CRUD METHODS ---
|
||||||
|
|
||||||
|
public function storeModule(Request $request)
|
||||||
|
{
|
||||||
|
$request->validate([
|
||||||
|
'course_id' => 'required',
|
||||||
|
'module_code' => 'required|string|max:50',
|
||||||
|
'title' => 'required|string|max:255',
|
||||||
|
'semester' => 'required|string',
|
||||||
|
'credits' => 'nullable|integer',
|
||||||
|
'description' => 'nullable|string',
|
||||||
|
]);
|
||||||
|
|
||||||
|
DB::table('course_modules')->insert([
|
||||||
|
'course_id' => $request->course_id,
|
||||||
|
'module_code' => $request->module_code,
|
||||||
|
'title' => $request->title,
|
||||||
|
'semester' => $request->semester,
|
||||||
|
'credits' => $request->credits,
|
||||||
|
'description' => $request->description,
|
||||||
|
'created_at' => now(),
|
||||||
|
'updated_at' => now(),
|
||||||
|
]);
|
||||||
|
|
||||||
|
return redirect()->back()->with('success', 'Module added successfully!');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function updateModule(Request $request, $id)
|
||||||
|
{
|
||||||
|
$request->validate([
|
||||||
|
'module_code' => 'required|string|max:50',
|
||||||
|
'title' => 'required|string|max:255',
|
||||||
|
'semester' => 'required|string',
|
||||||
|
'credits' => 'nullable|integer',
|
||||||
|
'description' => 'nullable|string',
|
||||||
|
]);
|
||||||
|
|
||||||
|
DB::table('course_modules')->where('id', $id)->update([
|
||||||
|
'module_code' => $request->module_code,
|
||||||
|
'title' => $request->title,
|
||||||
|
'semester' => $request->semester,
|
||||||
|
'credits' => $request->credits,
|
||||||
|
'description' => $request->description,
|
||||||
|
'updated_at' => now(),
|
||||||
|
]);
|
||||||
|
|
||||||
|
return redirect()->back()->with('success', 'Module updated successfully!');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function destroyModule($id)
|
||||||
|
{
|
||||||
|
DB::table('course_modules')->where('id', $id)->delete();
|
||||||
|
return redirect()->back()->with('success', 'Module deleted successfully!');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
class courseModules extends Model
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,33 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
class Module extends Model
|
||||||
|
{
|
||||||
|
use HasFactory;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Mass assignable attributes.
|
||||||
|
*
|
||||||
|
* @var array<int, string>
|
||||||
|
*/
|
||||||
|
protected $fillable = [
|
||||||
|
'course_id',
|
||||||
|
'module_code',
|
||||||
|
'title',
|
||||||
|
'semester',
|
||||||
|
'credits',
|
||||||
|
'description',
|
||||||
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the course that owns the module.
|
||||||
|
*/
|
||||||
|
public function course()
|
||||||
|
{
|
||||||
|
return $this->belongsTo(Course::class);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,28 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*/
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
Schema::table('modules', function (Blueprint $table) {
|
||||||
|
$table->string('semester')->after('title')->nullable();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::table('modules', function (Blueprint $table) {
|
||||||
|
$table->dropColumn('semester');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
@ -0,0 +1,33 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*/
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
Schema::create('course_modules', function (Blueprint $table) {
|
||||||
|
$table->id();
|
||||||
|
$table->foreignId('course_id')->constrained('courses')->onDelete('cascade');
|
||||||
|
$table->string('module_code');
|
||||||
|
$table->string('title');
|
||||||
|
$table->string('semester');
|
||||||
|
$table->integer('credits')->nullable();
|
||||||
|
$table->text('description')->nullable();
|
||||||
|
$table->timestamps();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('course_modules');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
@ -292,6 +292,13 @@
|
||||||
@endif
|
@endif
|
||||||
</td>
|
</td>
|
||||||
<td class="text-center">
|
<td class="text-center">
|
||||||
|
<!-- View Modules Button -->
|
||||||
|
<button class="btn btn-sm btn-outline-info me-1"
|
||||||
|
data-bs-toggle="modal"
|
||||||
|
data-bs-target="#modulesModal{{ $course->id }}">
|
||||||
|
<i class="fa-solid fa-layer-group me-1"></i> Modules
|
||||||
|
</button>
|
||||||
|
|
||||||
<!-- Edit Button -->
|
<!-- Edit Button -->
|
||||||
<button class="btn btn-sm btn-outline-warning me-1"
|
<button class="btn btn-sm btn-outline-warning me-1"
|
||||||
data-bs-toggle="modal"
|
data-bs-toggle="modal"
|
||||||
|
|
@ -300,7 +307,6 @@
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<!-- Delete Form -->
|
<!-- Delete Form -->
|
||||||
|
|
||||||
<form action="{{ route('admin.courses.delete', $course->id) }}" method="POST" class="d-inline" onsubmit="return confirm('Are you sure you want to delete this course?')">
|
<form action="{{ route('admin.courses.delete', $course->id) }}" method="POST" class="d-inline" onsubmit="return confirm('Are you sure you want to delete this course?')">
|
||||||
@csrf
|
@csrf
|
||||||
@method('DELETE')
|
@method('DELETE')
|
||||||
|
|
@ -311,6 +317,167 @@
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
<!-- MODULES MANAGEMENT MODAL -->
|
||||||
|
<div class="modal fade" id="modulesModal{{ $course->id }}" tabindex="-1" aria-hidden="true">
|
||||||
|
<div class="modal-dialog modal-xl">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header bg-navy text-white" style="background-color: var(--theme-navy);">
|
||||||
|
<h5 class="modal-title fw-bold text-white">
|
||||||
|
<i class="fa-solid fa-layer-group me-2"></i>Modules - {{ $course->title }} ({{ $course->course_code }})
|
||||||
|
</h5>
|
||||||
|
<button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal"></button>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body bg-light">
|
||||||
|
<div class="row g-4">
|
||||||
|
<!-- Left Side: Modules List by Semester -->
|
||||||
|
<div class="col-lg-7">
|
||||||
|
<div class="card border-0 shadow-sm">
|
||||||
|
<div class="card-header bg-white fw-bold py-3">
|
||||||
|
<i class="fa-solid fa-list-check me-2 text-primary"></i>Course Modules List
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
@php
|
||||||
|
$groupedModules = $course->modules ? $course->modules->groupBy('semester') : collect();
|
||||||
|
@endphp
|
||||||
|
|
||||||
|
@forelse($groupedModules as $semester => $modules)
|
||||||
|
<div class="mb-4">
|
||||||
|
<h6 class="fw-bold text-uppercase text-secondary border-bottom pb-2">
|
||||||
|
<i class="fa-solid fa-calendar-week me-2"></i>{{ $semester }}
|
||||||
|
</h6>
|
||||||
|
<div class="list-group">
|
||||||
|
@foreach($modules as $module)
|
||||||
|
<div class="list-group-item d-flex justify-content-between align-items-center">
|
||||||
|
<div>
|
||||||
|
<span class="badge bg-secondary me-2">{{ $module->module_code }}</span>
|
||||||
|
<strong class="text-dark">{{ $module->title }}</strong>
|
||||||
|
@if($module->credits)
|
||||||
|
<span class="small text-muted ms-2">({{ $module->credits }} Credits)</span>
|
||||||
|
@endif
|
||||||
|
@if($module->description)
|
||||||
|
<p class="mb-0 text-muted small mt-1">{{ $module->description }}</p>
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
<div class="d-flex align-items-center gap-2">
|
||||||
|
<!-- Edit Module Button -->
|
||||||
|
<button class="btn btn-sm btn-outline-warning"
|
||||||
|
data-bs-toggle="collapse"
|
||||||
|
data-bs-target="#editModuleCollapse{{ $module->id }}">
|
||||||
|
<i class="fa-solid fa-pen"></i>
|
||||||
|
</button>
|
||||||
|
<!-- Delete Module Form -->
|
||||||
|
<form action="{{ url('/admin/modules/' . $module->id) }}" method="POST" onsubmit="return confirm('Delete this module?')">
|
||||||
|
@csrf
|
||||||
|
@method('DELETE')
|
||||||
|
<button type="submit" class="btn btn-sm btn-outline-danger">
|
||||||
|
<i class="fa-solid fa-trash"></i>
|
||||||
|
</button>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Inline Edit Module Collapse Form -->
|
||||||
|
<div class="collapse mt-2 p-3 bg-white border rounded" id="editModuleCollapse{{ $module->id }}">
|
||||||
|
<form action="{{ url('/admin/modules/update/' . $module->id) }}" method="POST">
|
||||||
|
@csrf
|
||||||
|
<h6 class="fw-bold text-warning mb-3"><i class="fa-solid fa-pen-to-square me-1"></i>Edit Module</h6>
|
||||||
|
<div class="row g-2">
|
||||||
|
<div class="col-md-4">
|
||||||
|
<input type="text" name="module_code" class="form-control form-control-sm" value="{{ $module->module_code }}" placeholder="Code" required>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-8">
|
||||||
|
<input type="text" name="title" class="form-control form-control-sm" value="{{ $module->title }}" placeholder="Title" required>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<select name="semester" class="form-select form-select-sm" required>
|
||||||
|
<option value="Semester 1" {{ $module->semester == 'Semester 1' ? 'selected' : '' }}>Semester 1</option>
|
||||||
|
<option value="Semester 2" {{ $module->semester == 'Semester 2' ? 'selected' : '' }}>Semester 2</option>
|
||||||
|
<option value="Semester 3" {{ $module->semester == 'Semester 3' ? 'selected' : '' }}>Semester 3</option>
|
||||||
|
<option value="Semester 4" {{ $module->semester == 'Semester 4' ? 'selected' : '' }}>Semester 4</option>
|
||||||
|
<option value="Year 1" {{ $module->semester == 'Year 1' ? 'selected' : '' }}>Year 1</option>
|
||||||
|
<option value="Year 2" {{ $module->semester == 'Year 2' ? 'selected' : '' }}>Year 2</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<input type="number" name="credits" class="form-control form-control-sm" value="{{ $module->credits }}" placeholder="Credits">
|
||||||
|
</div>
|
||||||
|
<div class="col-md-12">
|
||||||
|
<textarea name="description" class="form-control form-control-sm" rows="2" placeholder="Description">{{ $module->description }}</textarea>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-12 text-end mt-2">
|
||||||
|
<button type="submit" class="btn btn-sm btn-warning">Update Module</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
@endforeach
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@empty
|
||||||
|
<div class="text-center py-4 text-muted">
|
||||||
|
<i class="fa-solid fa-circle-info fa-2x mb-2 text-secondary"></i>
|
||||||
|
<p class="mb-0">No modules added yet for this course.</p>
|
||||||
|
</div>
|
||||||
|
@endforelse
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Right Side: Add New Module Form -->
|
||||||
|
<div class="col-lg-5">
|
||||||
|
<div class="card border-0 shadow-sm">
|
||||||
|
<div class="card-header bg-white fw-bold py-3">
|
||||||
|
<i class="fa-solid fa-plus-circle me-2 text-success"></i>Add New Module
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
<form action="{{ route('admin.modules.store') }}" method="POST">
|
||||||
|
@csrf
|
||||||
|
<input type="hidden" name="course_id" value="{{ $course->id }}">
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label class="form-label">Semester</label>
|
||||||
|
<select name="semester" class="form-select" required>
|
||||||
|
<option value="Semester 1">Semester 1</option>
|
||||||
|
<option value="Semester 2">Semester 2</option>
|
||||||
|
<option value="Semester 3">Semester 3</option>
|
||||||
|
<option value="Semester 4">Semester 4</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label class="form-label">Module Code</label>
|
||||||
|
<input type="text" name="module_code" class="form-control" placeholder="e.g. CS101" required>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label class="form-label">Module Title</label>
|
||||||
|
<input type="text" name="title" class="form-control" required>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label class="form-label">Credits</label>
|
||||||
|
<input type="number" name="credits" class="form-control" value="3">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label class="form-label">Description</label>
|
||||||
|
<textarea name="description" class="form-control" rows="2"></textarea>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<button type="submit" class="btn btn-primary w-100">Add Module</button>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- EDIT COURSE MODAL -->
|
<!-- EDIT COURSE MODAL -->
|
||||||
<div class="modal fade" id="editCourseModal{{ $course->id }}" tabindex="-1" aria-hidden="true">
|
<div class="modal fade" id="editCourseModal{{ $course->id }}" tabindex="-1" aria-hidden="true">
|
||||||
<div class="modal-dialog modal-lg">
|
<div class="modal-dialog modal-lg">
|
||||||
|
|
@ -318,7 +485,9 @@
|
||||||
<form action="{{ route('admin.courses.update', $course->id) }}" method="POST" enctype="multipart/form-data">
|
<form action="{{ route('admin.courses.update', $course->id) }}" method="POST" enctype="multipart/form-data">
|
||||||
@csrf
|
@csrf
|
||||||
<div class="modal-header bg-warning text-dark">
|
<div class="modal-header bg-warning text-dark">
|
||||||
<h5 class="modal-title fw-bold"><i class="fa-solid fa-pen-to-square me-2"></i>Edit Course</h5>
|
<h5 class="modal-title fw-bold"><i class="fa-solid fa-pen-to-square me-2">
|
||||||
|
|
||||||
|
</i>Edit Course</h5>
|
||||||
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
|
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
|
|
|
||||||
|
|
@ -134,52 +134,54 @@ Route::get('/admin/login', [AdminAuthController::class, 'showLoginForm'])->name(
|
||||||
Route::post('/admin/login', [AdminAuthController::class, 'login']);
|
Route::post('/admin/login', [AdminAuthController::class, 'login']);
|
||||||
Route::post('/admin/logout', [AdminAuthController::class, 'logout'])->name('admin.logout');
|
Route::post('/admin/logout', [AdminAuthController::class, 'logout'])->name('admin.logout');
|
||||||
|
|
||||||
Route::middleware(['web'])->prefix('admin')->group(function () {
|
// outer group එකට .name('admin.') එක් කරන්න
|
||||||
|
Route::middleware(['web'])->prefix('admin')->name('admin.')->group(function () {
|
||||||
|
|
||||||
// Admin Dashboard & Notifications Routes
|
// Admin Dashboard & Notifications
|
||||||
Route::get('/dashboard', [AdminDashboardController::class, 'index'])->name('admin.dashboard');
|
Route::get('/dashboard', [AdminDashboardController::class, 'index'])->name('dashboard');
|
||||||
Route::post('/notifications', [AdminDashboardController::class, 'store'])->name('admin.notifications.store');
|
Route::post('/notifications', [AdminDashboardController::class, 'store'])->name('notifications.store');
|
||||||
Route::put('/notifications/{id}', [AdminDashboardController::class, 'update'])->name('admin.notifications.update');
|
Route::put('/notifications/{id}', [AdminDashboardController::class, 'update'])->name('notifications.update');
|
||||||
Route::delete('/notifications/{id}', [AdminDashboardController::class, 'destroy'])->name('admin.notifications.destroy');
|
Route::delete('/notifications/{id}', [AdminDashboardController::class, 'destroy'])->name('notifications.destroy');
|
||||||
Route::post('/notifications/read/{id}', [AdminDashboardController::class, 'markAsRead'])->name('admin.notifications.read');
|
Route::post('/notifications/read/{id}', [AdminDashboardController::class, 'markAsRead'])->name('notifications.read');
|
||||||
|
|
||||||
// Admin Users Management
|
// Admin Users Management
|
||||||
Route::delete('/users/{id}', [AdminDashboardController::class, 'destroyUser'])->name('admin.users.destroy');
|
Route::delete('/users/{id}', [AdminDashboardController::class, 'destroyUser'])->name('users.destroy');
|
||||||
|
|
||||||
// Student Portal Log Management (Main User Table එකට හානියක් නොවී Portal Log එක පමණක් පාලනය කිරීමට)
|
// Student Portal Log Management
|
||||||
Route::post('/portal-logs', [AdminDashboardController::class, 'storePortalLog'])->name('admin.portallogs.store');
|
Route::post('/portal-logs', [AdminDashboardController::class, 'storePortalLog'])->name('portallogs.store');
|
||||||
Route::post('/portal-logs/send/{userId}', [AdminDashboardController::class, 'sendToPortalLog'])->name('admin.portallogs.send');
|
Route::post('/portal-logs/send/{userId}', [AdminDashboardController::class, 'sendToPortalLog'])->name('portallogs.send');
|
||||||
Route::put('/portal-logs/{userId}/pin', [AdminDashboardController::class, 'updatePin'])->name('admin.portallogs.update');
|
Route::put('/portal-logs/{userId}/pin', [AdminDashboardController::class, 'updatePin'])->name('portallogs.update');
|
||||||
Route::delete('/portal-logs/{id}', [AdminDashboardController::class, 'destroyPortalLog'])->name('admin.portallogs.destroy');
|
Route::delete('/portal-logs/{id}', [AdminDashboardController::class, 'destroyPortalLog'])->name('portallogs.destroy');
|
||||||
|
|
||||||
// Admin Courses
|
// Admin Courses
|
||||||
Route::get('/adminmycourses', [adminmycoursesController::class, 'index'])->name('admin.mycourses');
|
Route::get('/adminmycourses', [adminmycoursesController::class, 'index'])->name('mycourses');
|
||||||
Route::post('/adminmycourses/store', [adminmycoursesController::class, 'store'])->name('admin.courses.store');
|
Route::post('/adminmycourses/store', [adminmycoursesController::class, 'store'])->name('courses.store');
|
||||||
Route::post('/adminmycourses/update/{id}', [adminmycoursesController::class, 'update'])->name('admin.courses.update');
|
Route::post('/adminmycourses/update/{id}', [adminmycoursesController::class, 'update'])->name('courses.update');
|
||||||
Route::delete('/courses/{id}', [adminmycoursesController::class, 'destroy'])->name('admin.courses.delete');
|
Route::delete('/courses/{id}', [adminmycoursesController::class, 'destroy'])->name('courses.delete');
|
||||||
|
|
||||||
// Admin Timetable Routes
|
// Admin Timetable Routes
|
||||||
Route::get('/timetable', [AdminTimetableController::class, 'index'])->name('admin.timetable');
|
Route::get('/timetable', [AdminTimetableController::class, 'index'])->name('timetable');
|
||||||
Route::post('/timetable/store', [AdminTimetableController::class, 'store'])->name('admin.timetable.store');
|
Route::post('/timetable/store', [AdminTimetableController::class, 'store'])->name('timetable.store');
|
||||||
Route::put('/timetable/update/{id}', [AdminTimetableController::class, 'update'])->name('admin.timetable.update');
|
Route::put('/timetable/update/{id}', [AdminTimetableController::class, 'update'])->name('timetable.update');
|
||||||
Route::delete('/timetable/delete/{id}', [AdminTimetableController::class, 'destroy'])->name('admin.timetable.delete');
|
Route::delete('/timetable/delete/{id}', [AdminTimetableController::class, 'destroy'])->name('timetable.delete');
|
||||||
|
|
||||||
|
// Admin Course Modules CRUD
|
||||||
|
Route::post('/modules/store', [adminmycoursesController::class, 'storeModule'])->name('modules.store');
|
||||||
|
Route::post('/modules/update/{id}', [adminmycoursesController::class, 'updateModule'])->name('modules.update');
|
||||||
|
Route::delete('/modules/{id}', [adminmycoursesController::class, 'destroyModule'])->name('modules.delete');
|
||||||
|
|
||||||
// Admin Results
|
// Admin Results
|
||||||
Route::get('/results', [AdminResultsController::class, 'index'])->name('admin.results');
|
Route::get('/results', [AdminResultsController::class, 'index'])->name('results.index');
|
||||||
Route::post('/results/store', [AdminResultsController::class, 'store'])->name('admin.results.store');
|
Route::post('/results/store', [AdminResultsController::class, 'store'])->name('results.store');
|
||||||
Route::put('/results/update/{id}', [AdminResultsController::class, 'update'])->name('admin.results.update');
|
Route::put('/results/update/{id}', [AdminResultsController::class, 'update'])->name('results.update');
|
||||||
Route::delete('/results/delete/{id}', [AdminResultsController::class, 'destroy'])->name('admin.results.delete');
|
Route::delete('/results/delete/{id}', [AdminResultsController::class, 'destroy'])->name('results.delete');
|
||||||
|
Route::post('/results/import', [AdminResultsController::class, 'import'])->name('results.import');
|
||||||
|
|
||||||
// Admin Profile
|
// Admin Profile
|
||||||
Route::get('/profile', [AdminProfileController::class, 'index'])->name('admin.profile');
|
Route::get('/profile', [AdminProfileController::class, 'index'])->name('profile');
|
||||||
Route::put('/profile/update', [AdminProfileController::class, 'update'])->name('admin.profile.update');
|
Route::put('/profile/update', [AdminProfileController::class, 'update'])->name('profile.update');
|
||||||
Route::put('/profile/password', [AdminProfileController::class, 'updatePassword'])->name('admin.profile.password');
|
Route::put('/profile/password', [AdminProfileController::class, 'updatePassword'])->name('profile.password');
|
||||||
Route::prefix('admin')->name('admin.')->group(function () {
|
|
||||||
|
|
||||||
Route::get('/results', [AdminResultsController::class, 'index'])->name('results.index');
|
// Course Assign
|
||||||
|
Route::post('/courses/assign', [adminmycoursesController::class, 'assignCourse'])->name('courses.assign');
|
||||||
|
|
||||||
Route::post('/results/import', [AdminResultsController::class, 'import'])->name('results.import');
|
|
||||||
Route::post('/admin/courses/assign', [adminmycoursesController::class, 'assignCourse'])->name('admin.courses.assign');
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
Loading…
Reference in New Issue