From 2aa0cf0449dd9e27e71c0b73cad763ef468a04ed Mon Sep 17 00:00:00 2001 From: Sallu9007 Date: Mon, 31 Mar 2025 22:57:21 +0530 Subject: [PATCH] Feat: books published --- app/Http/Controllers/AdminController.php | 5 +- .../Controllers/BooksPublishedController.php | 183 +++++++++++++++++ .../Controllers/CoordinatorController.php | 5 + app/Http/Controllers/FacultyController.php | 191 ++++++++++++------ app/Models/BooksPublished.php | 44 ++++ ...31_145615_create_books_published_table.php | 48 +++++ resources/views/booksPublished/edit.blade.php | 107 ++++++++++ .../views/booksPublished/index.blade.php | 186 +++++++++++++++++ .../faculty/booksPublished-form.blade.php | 98 +++++++++ resources/views/layouts/navigation.blade.php | 21 ++ routes/web.php | 26 +++ 11 files changed, 853 insertions(+), 61 deletions(-) create mode 100644 app/Http/Controllers/BooksPublishedController.php create mode 100644 app/Models/BooksPublished.php create mode 100644 database/migrations/2025_03_31_145615_create_books_published_table.php create mode 100644 resources/views/booksPublished/edit.blade.php create mode 100644 resources/views/booksPublished/index.blade.php create mode 100644 resources/views/faculty/booksPublished-form.blade.php diff --git a/app/Http/Controllers/AdminController.php b/app/Http/Controllers/AdminController.php index 39b6348..5d3c59e 100644 --- a/app/Http/Controllers/AdminController.php +++ b/app/Http/Controllers/AdminController.php @@ -34,5 +34,8 @@ class AdminController extends Controller { return view('publications.index'); } - + public function viewBooksPublishedResponses() + { + return view('booksPublished.index'); + } } diff --git a/app/Http/Controllers/BooksPublishedController.php b/app/Http/Controllers/BooksPublishedController.php new file mode 100644 index 0000000..e59a786 --- /dev/null +++ b/app/Http/Controllers/BooksPublishedController.php @@ -0,0 +1,183 @@ +validate([ + 'author' => 'required|string', + 'title' => 'required|string', + 'publisher' => 'required|string', + 'issn' => [ + 'nullable', + 'string', + 'regex:/^(\d{4}-\d{3}[\dX]|\d{8}|\d{4}\s\d{3}[\dX])$/' + ], + 'date_of_publication' => 'required|date', + 'proof_file' => 'nullable|mimes:jpg,jpeg,png,pdf,doc,docx,zip', + ], [ + 'issn.regex' => 'The ISSN format is invalid. It should be in the format XXXX-XXXX or XXXXXXXX.' + ]); + + // Handle the file upload if a new file is provided + if ($request->hasFile('proof_file')) { + // Delete old file if exists + if ($booksPublished->proof && Storage::disk('public')->exists($booksPublished->proof)) { + Storage::disk('public')->delete($booksPublished->proof); + } + + // Extract year from start_date + $year = date('Y', strtotime($validated['date_of_publication'])); + $username = $booksPublished->user->name; + + $originalName = $request->file('proof_file')->getClientOriginalName(); + $fileName = $username . '_' . $originalName; + + // Create path structure: year/faculty_name/BooksPublished + $folderPath = 'proofs/' . $year . '/' . $username . '/BooksPublished'; + + // Store file in the specified path + $paperFilePath = $request->file('proof_file')->storeAs($folderPath, $fileName, 'public'); + + $booksPublished->proof = $paperFilePath; + } + + // Update other fields + $booksPublished->author = $validated['author']; + $booksPublished->title = $validated['title']; + $booksPublished->publisher = $validated['publisher']; + $booksPublished->issn = $validated['issn']; + $booksPublished->date_of_publication = $validated['date_of_publication']; + + $booksPublished->save(); + + $userRole = auth()->user()->role->name; + + if ($userRole === 'Admin') { + return redirect()->route('admin.BooksPublishedResponses') + ->with('status', 'Publication updated successfully'); + } elseif ($userRole === 'Coordinator') { + return redirect()->route('coordinator.BooksPublishedResponses') + ->with('status', 'Publication updated successfully'); + } else { + // For regular users + return redirect()->route('faculty.BooksPublishedResponses') + ->with('status', 'Publication updated successfully'); + } + } catch (\Illuminate\Database\Eloquent\ModelNotFoundException $e) { + return back()->withErrors(['error' => 'Publication not found.']); + } catch (\Illuminate\Validation\ValidationException $e) { + return back()->withErrors($e->validator)->withInput(); + } catch (\Exception $e) { + return back()->withErrors(['error' => 'An error occurred: ' . $e->getMessage()])->withInput(); + } + } + + public function destroy($id) + { + $booksPublished = BooksPublished::findOrFail($id); + + // Delete the file if it exists + if ($booksPublished->proof && Storage::disk('public')->exists($booksPublished->proof)) { + Storage::disk('public')->delete($booksPublished->proof); + } + + $booksPublished->delete(); + + return response()->json(['success' => 'Publication deleted successfully']); + } + + public function getBooksPublishedResponses() + { + $user = auth()->user(); + $isAdmin = $user->role->name === 'Admin'; + $isCoordinator = $user->role->name === 'Coordinator'; + + // Query based on role + if ($isAdmin) { + // Admin sees all records + $booksPublisheds = BooksPublished::with('user', 'department'); + } elseif ($isCoordinator) { + // Coordinator sees only their department's records + $booksPublisheds = BooksPublished::with('user', 'department') + ->whereHas('user', function ($query) use ($user) { + $query->where('department_id', $user->department_id); + }); + } else { + // Regular users see only their own records + $booksPublisheds = BooksPublished::with('user', 'department') + ->where('faculty_id', $user->id); + } + + return DataTables::of($booksPublisheds) + ->addColumn('user_name', function ($booksPublished) { + return $booksPublished->user->name ?? 'Unknown'; + }) + ->addColumn('department_name', function ($booksPublished) { + return $booksPublished->department->name ?? 'Unknown'; + }) + ->addColumn('author', function ($booksPublished) { + return $booksPublished->author ?? 'Unknown'; + }) + ->addColumn('title', function ($booksPublished) { + return $booksPublished->title ?? 'Unknown'; + }) + ->addColumn('publisher', function ($booksPublished) { + return $booksPublished->publisher ?? 'Unknown'; + }) + ->addColumn('issn', function ($booksPublished) { + return $booksPublished->issn ?? 'NA'; + }) + ->addColumn('date_of_publication', function ($booksPublished) { + return \Carbon\Carbon::parse($booksPublished->date_of_publication)->format('d-m-Y'); + }) + ->addColumn('action', function ($booksPublished) { + $actions = []; + + // View proof button for everyone + if ($booksPublished->proof) { + $actions[] = 'View'; + } else { + $actions[] = 'No Proof'; + } + + // Edit button with role-appropriate route + $userRole = auth()->user()->role->name; + // Determine the appropriate route based on user role + if ($userRole === 'Admin') { + $editRoute = route('admin.BooksPublished.edit', $booksPublished->id); + } elseif ($userRole === 'Coordinator') { + $editRoute = route('coordinator.BooksPublished.edit', $booksPublished->id); + } else { + $editRoute = route('faculty.BooksPublished.edit', $booksPublished->id); + } + + $actions[] = 'Edit'; + + $deleteRoute = route('booksPublished.destroy', $booksPublished->id); + $actions[] = ''; + + return implode(' ', $actions); + }) + ->rawColumns(['action']) + ->make(true); + } +} diff --git a/app/Http/Controllers/CoordinatorController.php b/app/Http/Controllers/CoordinatorController.php index 4a5c856..455774e 100644 --- a/app/Http/Controllers/CoordinatorController.php +++ b/app/Http/Controllers/CoordinatorController.php @@ -36,4 +36,9 @@ class CoordinatorController extends Controller return view('publications.index'); } + public function viewBooksPublishedResponses() + { + return view('booksPublished.index'); + } + } diff --git a/app/Http/Controllers/FacultyController.php b/app/Http/Controllers/FacultyController.php index 0d522ef..b691e04 100644 --- a/app/Http/Controllers/FacultyController.php +++ b/app/Http/Controllers/FacultyController.php @@ -5,6 +5,7 @@ namespace App\Http\Controllers; use Illuminate\Http\Request; use App\Models\ActivitiesAttended; use App\Models\ActivitiesOrganised; +use App\Models\BooksPublished; use App\Models\IvOrganised; use App\Models\Publication; @@ -60,6 +61,17 @@ class FacultyController extends Controller return view('publications.index'); } + public function BooksPublishedForm() + { + // Logic to show the response form + return view('faculty.booksPublished-form'); + } + + public function viewBooksPublishedResponses() + { + return view('booksPublished.index'); + } + public function ActivitiesAttendedFormResponse(Request $request) { try { @@ -270,73 +282,132 @@ class FacultyController extends Controller } public function PublicationsFormResponse(Request $request) -{ - try { - // Validate the request data - $validated = $request->validate([ - 'first_author_name' => 'required|string', - 'co_authors' => 'nullable|string', - 'start_date' => 'required|date', - 'start_time' => 'required|date_format:H:i', - 'end_date' => 'required|date', - 'end_time' => 'required|date_format:H:i', - 'num_days' => 'required|integer', - 'activity_type' => 'required|string', - 'title' => 'required|string', - 'affiliation' => 'required|string', - 'organizing_institute' => 'required|string', - 'venue_address' => 'required|string', - 'is_peer_reviewed' => 'required|in:yes,no', - 'scopus_link' => 'nullable|url', - 'sci_link' => 'nullable|url', - 'paper_file' => 'nullable|mimes:jpg,jpeg,png,pdf,doc,docx,zip', - ]); + { + try { + // Validate the request data + $validated = $request->validate([ + 'first_author_name' => 'required|string', + 'co_authors' => 'nullable|string', + 'start_date' => 'required|date', + 'start_time' => 'required|date_format:H:i', + 'end_date' => 'required|date', + 'end_time' => 'required|date_format:H:i', + 'num_days' => 'required|integer', + 'activity_type' => 'required|string', + 'title' => 'required|string', + 'affiliation' => 'required|string', + 'organizing_institute' => 'required|string', + 'venue_address' => 'required|string', + 'is_peer_reviewed' => 'required|in:yes,no', + 'scopus_link' => 'nullable|url', + 'sci_link' => 'nullable|url', + 'paper_file' => 'nullable|mimes:jpg,jpeg,png,pdf,doc,docx,zip', + ]); - // Combine start date and time - $startDateTime = date('Y-m-d H:i:s', strtotime("{$validated['start_date']} {$validated['start_time']}")); - $endDateTime = date('Y-m-d H:i:s', strtotime("{$validated['end_date']} {$validated['end_time']}")); + // Combine start date and time + $startDateTime = date('Y-m-d H:i:s', strtotime("{$validated['start_date']} {$validated['start_time']}")); + $endDateTime = date('Y-m-d H:i:s', strtotime("{$validated['end_date']} {$validated['end_time']}")); - // Handle the file upload - $paperFilePath = null; - if ($request->hasFile('paper_file')) { - $originalName = $request->file('paper_file')->getClientOriginalName(); - $username = auth()->user()->name; - $fileName = $username . '_' . $originalName; + // Handle the file upload + $paperFilePath = null; + if ($request->hasFile('paper_file')) { + $originalName = $request->file('paper_file')->getClientOriginalName(); + $username = auth()->user()->name; + $fileName = $username . '_' . $originalName; - // Extract year from start_date - $year = date('Y', strtotime($validated['start_date'])); + // Extract year from start_date + $year = date('Y', strtotime($validated['start_date'])); - // Create path structure: year/faculty_name/Publications - $folderPath = 'proofs/' . $year . '/' . $username . '/Publications'; + // Create path structure: year/faculty_name/Publications + $folderPath = 'proofs/' . $year . '/' . $username . '/Publications'; - // Store file in the specified path - $paperFilePath = $request->file('paper_file')->storeAs($folderPath, $fileName, 'public'); + // Store file in the specified path + $paperFilePath = $request->file('paper_file')->storeAs($folderPath, $fileName, 'public'); + } + + // Save the response to the database + Publication::create([ + 'department_id' => auth()->user()->department->id, + 'first_author_name' => $validated['first_author_name'], + 'co_authors' => $validated['co_authors'], + 'start_date' => $startDateTime, + 'end_date' => $endDateTime, + 'num_days' => $validated['num_days'], + 'activity_type' => $validated['activity_type'], + 'title' => $validated['title'], + 'affiliation' => $validated['affiliation'], + 'organizing_institute' => $validated['organizing_institute'], + 'venue_address' => $validated['venue_address'], + 'is_peer_reviewed' => $validated['is_peer_reviewed'], + 'scopus_link' => $validated['scopus_link'], + 'sci_link' => $validated['sci_link'], + 'paper_file' => $paperFilePath, + 'faculty_id' => auth()->user()->id, + ]); + + return redirect()->route('faculty.dashboard')->with('status', 'Publication details submitted successfully'); + } catch (\Exception $e) { + // Handle the exception and provide an error message + return back()->withErrors('An error occurred while submitting your publication: ' . $e->getMessage()); } + } + public function BooksPublishedFormResponse(Request $request) + { + // dd($request->all()); + try { + // Validate the request data + $validated = $request->validate([ + 'author' => 'required|string', + 'title' => 'required|string', + 'publisher' => 'required|string', + 'issn' => [ + 'nullable', + 'string', + 'regex:/^(\d{4}-\d{3}[\dX]|\d{8}|\d{4}\s\d{3}[\dX])$/' + ], + 'date_of_publication' => 'required|date', + 'proof_file' => 'nullable|mimes:jpg,jpeg,png,pdf,doc,docx,zip', + ], [ + 'issn.regex' => 'The ISSN format is invalid. It should be in the format XXXX-XXXX or XXXXXXXX.' + ]); - // Save the response to the database - Publication::create([ - 'department_id' => auth()->user()->department->id, - 'first_author_name' => $validated['first_author_name'], - 'co_authors' => $validated['co_authors'], - 'start_date' => $startDateTime, - 'end_date' => $endDateTime, - 'num_days' => $validated['num_days'], - 'activity_type' => $validated['activity_type'], - 'title' => $validated['title'], - 'affiliation' => $validated['affiliation'], - 'organizing_institute' => $validated['organizing_institute'], - 'venue_address' => $validated['venue_address'], - 'is_peer_reviewed' => $validated['is_peer_reviewed'], - 'scopus_link' => $validated['scopus_link'], - 'sci_link' => $validated['sci_link'], - 'paper_file' => $paperFilePath, - 'faculty_id' => auth()->user()->id, - ]); + // Handle the file upload + $proofFilePath = null; + if ($request->hasFile('proof_file')) { + $originalName = $request->file('proof_file')->getClientOriginalName(); + $username = auth()->user()->name; + $fileName = $username . '_' . $originalName; - return redirect()->route('faculty.dashboard')->with('status', 'Publication details submitted successfully'); - } catch (\Exception $e) { - // Handle the exception and provide an error message - return back()->withErrors('An error occurred while submitting your publication: ' . $e->getMessage()); + // Extract year from start_date + $year = date('Y', strtotime($validated['date_of_publication'])); + + // Create path structure: year/faculty_name/Publications + $folderPath = 'proofs/' . $year . '/' . $username . '/Publications'; + + // Store file in the specified path + $proofFilePath = $request->file('proof_file')->storeAs($folderPath, $fileName, 'public'); + } + // dd($proofFilePath); + + // Save the response to the database + BooksPublished::create([ + 'department_id' => auth()->user()->department->id, + 'author' => $validated['author'], + 'title' => $validated['title'], + 'publisher' => $validated['publisher'], + 'issn' => $validated['issn'], + 'date_of_publication' => $validated['date_of_publication'], + 'proof' => $proofFilePath, + 'faculty_id' => auth()->user()->id, + ]); + + return redirect()->route('faculty.dashboard')->with('status', 'Publication details submitted successfully'); + } catch (\Illuminate\Database\Eloquent\ModelNotFoundException $e) { + return back()->withErrors(['error' => 'Publication not found.']); + } catch (\Illuminate\Validation\ValidationException $e) { + return back()->withErrors($e->validator)->withInput(); + } catch (\Exception $e) { + return back()->withErrors(['error' => 'An error occurred: ' . $e->getMessage()])->withInput(); + } } } -} diff --git a/app/Models/BooksPublished.php b/app/Models/BooksPublished.php new file mode 100644 index 0000000..d340e11 --- /dev/null +++ b/app/Models/BooksPublished.php @@ -0,0 +1,44 @@ + 'date', + ]; + + /** + * Get the department that owns the publication. + */ + public function department() + { + return $this->belongsTo(Department::class); + } + + /** + * Get the faculty user that owns the publication. + */ + public function user() + { + return $this->belongsTo(User::class, 'faculty_id'); + } + +} \ No newline at end of file diff --git a/database/migrations/2025_03_31_145615_create_books_published_table.php b/database/migrations/2025_03_31_145615_create_books_published_table.php new file mode 100644 index 0000000..c4e00ea --- /dev/null +++ b/database/migrations/2025_03_31_145615_create_books_published_table.php @@ -0,0 +1,48 @@ +id(); + $table->unsignedBigInteger('department_id'); + $table->unsignedBigInteger('faculty_id'); // Faculty who uploaded the publication + $table->text('author'); + $table->string('title'); + $table->string('publisher'); + $table->string('issn', 9)->nullable(); + $table->date('date_of_publication'); + $table->string('proof')->nullable(); // For file path + + // Foreign keys + $table->foreign('department_id')->references('id')->on('departments')->onDelete('cascade'); + $table->foreign('faculty_id')->references('id')->on('users')->onDelete('cascade'); + + // Indexes for better performance + $table->index('department_id'); + $table->index('faculty_id'); + + $table->timestamps(); + }); + // Add ISSN format check constraint manually + DB::statement("ALTER TABLE books_published ADD CONSTRAINT chk_issn_format CHECK (issn REGEXP '^[0-9]{4}-[0-9]{3}[0-9X]$')"); + + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('books_published'); + } +}; diff --git a/resources/views/booksPublished/edit.blade.php b/resources/views/booksPublished/edit.blade.php new file mode 100644 index 0000000..ba5bd23 --- /dev/null +++ b/resources/views/booksPublished/edit.blade.php @@ -0,0 +1,107 @@ +@extends('layouts.app') + +@section('content') +
+
+
+

+ Edit Publication +

+
+ +
+ @if ($errors->any()) +
+
    + @foreach ($errors->all() as $error) +
  • {{ $error }}
  • + @endforeach +
+
+ @endif + +
+ @csrf + @method('PUT') +
+ +
+
+ + +
+
+ + +
+ + +
+ + +
+
+ + +
+
+ +
+ + +
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+ + @if ($booksPublished->proof_file) +
+ Current file: + View +
+ @endif + +

Accepted formats: JPG, JPEG, PNG, PDF, DOC, DOCX, ZIP

+
+
+ + +
+ + Cancel + + +
+
+
+
+
+ +@endsection \ No newline at end of file diff --git a/resources/views/booksPublished/index.blade.php b/resources/views/booksPublished/index.blade.php new file mode 100644 index 0000000..93790ba --- /dev/null +++ b/resources/views/booksPublished/index.blade.php @@ -0,0 +1,186 @@ +@extends('layouts.app') + +@section('content') +
+
+
+

+ All Books Published +

+
+
+
+ + + + + + + + + + + + + + + +
IDTitleAuthorPublisherDate of PublicationISSN/eISSN numberDepartmentActions
+
+
+
+
+@endsection + +@section('scripts') + + + + + + + + + + + +@endsection \ No newline at end of file diff --git a/resources/views/faculty/booksPublished-form.blade.php b/resources/views/faculty/booksPublished-form.blade.php new file mode 100644 index 0000000..3272eea --- /dev/null +++ b/resources/views/faculty/booksPublished-form.blade.php @@ -0,0 +1,98 @@ +@extends('layouts.app') + +@section('content') +
+
+
+

+ Submit Book Publication Details +

+

+ Fill in the details of your publication. +

+
+ @if ($errors->any()) +
+
    + @foreach ($errors->all() as $error) +
  • {{ $error }}
  • + @endforeach +
+
+ @endif +
+
+ @csrf +
+
+ + +
+
+ + +
+
+ + +
+ + +
+ + +
+
+ + +
+
+ +
+ + +
+ + +
+
+ + +
+
+ + + +
+
+ + +
+
+ + +
+
+ + +
+ + +

Accepted formats: JPG, JPEG, PNG, PDF, DOC, DOCX, ZIP

+
+
+
+ + +
+ +
+ +
+
+
+
+ +@endsection \ No newline at end of file diff --git a/resources/views/layouts/navigation.blade.php b/resources/views/layouts/navigation.blade.php index 9e26039..aa59707 100644 --- a/resources/views/layouts/navigation.blade.php +++ b/resources/views/layouts/navigation.blade.php @@ -30,6 +30,9 @@ {{ __('Publications') }} + + {{ __('Books Published') }} + @elseif(auth()->user()->role->name === 'Coordinator') @@ -45,6 +48,9 @@ {{ __('Publications') }} + + {{ __('Books Published') }} + @elseif(auth()->user()->role->name === 'Faculty') @@ -112,6 +118,21 @@ + +
+ + +
@endif diff --git a/routes/web.php b/routes/web.php index ecd060d..6986b33 100644 --- a/routes/web.php +++ b/routes/web.php @@ -8,6 +8,7 @@ use App\Http\Controllers\RoleController; use App\Http\Controllers\DepartmentController; use App\Http\Controllers\UserController; use App\Http\Controllers\AdminController; +use App\Http\Controllers\BooksPublishedController; use App\Http\Controllers\CoordinatorController; use App\Http\Controllers\FacultyController; use App\Http\Controllers\IvOrganisedController; @@ -52,6 +53,9 @@ Route::delete('/iv-organised/{id}', [IvOrganisedController::class, 'destroy'])-> // Publications common routes Route::delete('/publication/{id}', [PublicationsController::class, 'destroy'])->name('publications.destroy'); +// Books Published common routes +Route::delete('/booksPublished/{id}', [BooksPublishedController::class, 'destroy'])->name('booksPublished.destroy'); + // Admin routes Route::middleware(['auth', CheckRole::class . ':Admin'])->group(function () { Route::get('/admin', [AdminController::class, 'index'])->name('admin.dashboard'); @@ -83,6 +87,13 @@ Route::middleware(['auth', CheckRole::class . ':Admin'])->group(function () { Route::get('/admin/publication/{id}/edit', [PublicationsController::class, 'edit'])->name('admin.Publications.edit'); Route::put('/admin/publication/{id}', [PublicationsController::class, 'update'])->name('admin.Publications.update'); Route::delete('/admin/publication/{id}', [PublicationsController::class, 'destroy'])->name('admin.Publications.destroy'); + + // Books Published Routes + Route::get('/admin/BooksPublishedResponses', [AdminController::class, 'viewBooksPublishedResponses'])->name('admin.BooksPublishedResponses'); + Route::get('/admin/BooksPublishedResponses/data', [BooksPublishedController::class, 'getBooksPublishedResponses'])->name('admin.BooksPublishedResponses.data'); + Route::get('/admin/booksPublished/{id}/edit', [BooksPublishedController::class, 'edit'])->name('admin.BooksPublished.edit'); + Route::put('/admin/booksPublished/{id}', [BooksPublishedController::class, 'update'])->name('admin.BooksPublished.update'); + Route::delete('/admin/booksPublished/{id}', [BooksPublishedController::class, 'destroy'])->name('admin.BooksPublished.destroy'); }); // Coordinator routes @@ -116,6 +127,13 @@ Route::middleware(['auth', CheckRole::class . ':Coordinator'])->group(function ( Route::get('/coordinator/publication/{id}/edit', [PublicationsController::class, 'edit'])->name('coordinator.Publications.edit'); Route::put('/coordinator/publication/{id}', [PublicationsController::class, 'update'])->name('coordinator.Publications.update'); Route::delete('/coordinator/publication/{id}', [PublicationsController::class, 'destroy'])->name('coordinator.Publications.destroy'); + + // BooksPublished Routes + Route::get('/coordinator/BooksPublishedResponses', [CoordinatorController::class, 'viewBooksPublishedResponses'])->name('coordinator.BooksPublishedResponses'); + Route::get('/coordinator/BooksPublishedResponses/data', [BooksPublishedController::class, 'getBooksPublishedResponses'])->name('coordinator.BooksPublishedResponses.data'); + Route::get('/coordinator/booksPublished/{id}/edit', [BooksPublishedController::class, 'edit'])->name('coordinator.BooksPublished.edit'); + Route::put('/coordinator/booksPublished/{id}', [BooksPublishedController::class, 'update'])->name('coordinator.BooksPublished.update'); + Route::delete('/coordinator/booksPublished/{id}', [BooksPublishedController::class, 'destroy'])->name('coordinator.BooksPublished.destroy'); }); // Faculty routes @@ -153,6 +171,14 @@ Route::middleware(['auth', CheckRole::class . ':Faculty'])->group(function () { Route::get('/faculty/PublicationsResponses/data', [PublicationsController::class, 'getPublicationsResponses'])->name('faculty.PublicationsResponses.data'); Route::get('/faculty/publication/{id}/edit', [PublicationsController::class, 'edit'])->name('faculty.Publications.edit'); Route::put('/faculty/publication/{id}', [PublicationsController::class, 'update'])->name('faculty.Publications.update'); + + // Books Published Routes + Route::get('/faculty/BooksPublishedForm', [FacultyController::class, 'BooksPublishedForm'])->name('faculty.BooksPublishedForm'); + Route::post('/faculty/BooksPublishedFormResponse', [FacultyController::class, 'BooksPublishedFormResponse'])->name('faculty.BooksPublishedFormResponse'); + Route::get('/faculty/BooksPublishedResponses', [FacultyController::class, 'viewBooksPublishedResponses'])->name('faculty.BooksPublishedResponses'); + Route::get('/faculty/BooksPublishedResponses/data', [BooksPublishedController::class, 'getBooksPublishedResponses'])->name('faculty.BooksPublishedResponses.data'); + Route::get('/faculty/booksPublished/{id}/edit', [BooksPublishedController::class, 'edit'])->name('faculty.BooksPublished.edit'); + Route::put('/faculty/booksPublished/{id}', [BooksPublishedController::class, 'update'])->name('faculty.BooksPublished.update'); }); // API Resources