From 2c01ff3733d98a0c5cb065e3a999e2512c0c60aa Mon Sep 17 00:00:00 2001 From: B Vikas Chandra <48272577+vikaschandrab@users.noreply.github.com> Date: Sun, 11 Jan 2026 16:43:39 +0530 Subject: [PATCH] Added New Interview Section --- .../InterviewQuestionsController.php | 30 +++++ app/Models/InterviewQuestion.php | 16 +++ ...05832_create_interview_questions_table.php | 47 ++++++++ resources/css/pages/interview-questions.css | 113 ++++++++++++++++++ .../Pages/interviewQuestions/create.blade.php | 0 .../Pages/interviewQuestions/index.blade.php | 113 ++++++++++++++++++ .../views/Users/Partials/sidebar.blade.php | 7 ++ routes/web.php | 10 ++ 8 files changed, 336 insertions(+) create mode 100644 app/Http/Controllers/InterviewQuestionsController.php create mode 100644 app/Models/InterviewQuestion.php create mode 100644 database/migrations/2026_01_11_105832_create_interview_questions_table.php create mode 100644 resources/css/pages/interview-questions.css create mode 100644 resources/views/Users/Pages/interviewQuestions/create.blade.php create mode 100644 resources/views/Users/Pages/interviewQuestions/index.blade.php diff --git a/app/Http/Controllers/InterviewQuestionsController.php b/app/Http/Controllers/InterviewQuestionsController.php new file mode 100644 index 0000000..5418930 --- /dev/null +++ b/app/Http/Controllers/InterviewQuestionsController.php @@ -0,0 +1,30 @@ +latest() + ->paginate(10); + + $hasQuestions = $questions->count() > 0; + + return view('Users.Pages.interviewQuestions.index', compact('questions', 'hasQuestions')); + + // return view('Users.Pages.interviewQuestions.interviewQuestions'); + } +} diff --git a/app/Models/InterviewQuestion.php b/app/Models/InterviewQuestion.php new file mode 100644 index 0000000..c79fa0d --- /dev/null +++ b/app/Models/InterviewQuestion.php @@ -0,0 +1,16 @@ +id(); + + $table->foreignId('user_id') + ->constrained() + ->cascadeOnDelete(); + + $table->text('question'); + + $table->longText('answer')->nullable(); + + $table->enum('level', ['junior', 'mid', 'senior']) + ->default('junior'); + + $table->string('category', 100) + ->nullable() + ->index(); + + $table->timestamps(); + + // Optional but useful indexes + $table->index('level'); + $table->index(['user_id', 'category']); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('interview_questions'); + } +}; diff --git a/resources/css/pages/interview-questions.css b/resources/css/pages/interview-questions.css new file mode 100644 index 0000000..4b96748 --- /dev/null +++ b/resources/css/pages/interview-questions.css @@ -0,0 +1,113 @@ +/* ============================ + Interview Questions Page + ============================ */ + +/* Card Styling */ +.question-card { + transition: all 0.3s ease; + border-left: 4px solid transparent; +} + +.question-card:hover { + transform: translateY(-2px); + box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1); + border-left-color: #0d6efd; +} + +/* Question Title */ +.question-title { + font-weight: 600; + color: #495057; + line-height: 1.4; +} + +/* Meta Information */ +.question-meta { + font-size: 0.85rem; + color: #6c757d; + display: flex; + align-items: center; + gap: 0.5rem; +} + +/* Difficulty Badge */ +.question-level { + font-size: 0.7rem; + padding: 0.25rem 0.5rem; + border-radius: 0.375rem; + font-weight: 600; + text-transform: uppercase; +} + +.level-junior { + background: #e7f1ff; + color: #084298; + border: 1px solid #b6d4fe; +} + +.level-mid { + background: #fff3cd; + color: #664d03; + border: 1px solid #ffecb5; +} + +.level-senior { + background: #f8d7da; + color: #842029; + border: 1px solid #f5c2c7; +} + +/* Action Buttons */ +.question-actions .btn { + padding: 0.25rem 0.45rem; + display: flex; + align-items: center; + justify-content: center; +} + +.question-actions .btn i { + width: 14px; + height: 14px; +} + +/* Empty State */ +.empty-state { + text-align: center; + padding: 3rem 1rem; + color: #6c757d; +} + +.empty-state i { + width: 56px; + height: 56px; + margin-bottom: 1rem; + opacity: 0.6; +} + +/* Header Section */ +.page-header h1 { + font-weight: 600; +} + +.page-header p { + margin-bottom: 0; + color: #6c757d; +} + +/* Pagination Alignment */ +.pagination { + margin-top: 1.5rem; +} + +/* Responsive Tweaks */ +@media (max-width: 768px) { + .question-meta { + flex-direction: column; + align-items: flex-start; + gap: 0.25rem; + } + + .question-actions { + margin-top: 0.5rem; + } +} diff --git a/resources/views/Users/Pages/interviewQuestions/create.blade.php b/resources/views/Users/Pages/interviewQuestions/create.blade.php new file mode 100644 index 0000000..e69de29 diff --git a/resources/views/Users/Pages/interviewQuestions/index.blade.php b/resources/views/Users/Pages/interviewQuestions/index.blade.php new file mode 100644 index 0000000..435a7f6 --- /dev/null +++ b/resources/views/Users/Pages/interviewQuestions/index.blade.php @@ -0,0 +1,113 @@ +@extends('Users.Layouts.app') + +@section('title', 'About | ' . Auth::user()->name) + +@push('styles') + +@endpush + +@section('content') +
+ Manage your personal interview question bank +
+Create your first interview question to start building your library.
+ + {{-- + + Add New Question + --}} + +