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') +
+ + {{-- Header --}} +
+
+

+ My Interview Questions + Coming Soon +

+

+ Manage your personal interview question bank +

+
+ + {{-- + + Add New Question + --}} + +
+ + {{-- Question List --}} + @if($hasQuestions) +
+ @foreach($questions as $question) +
+
+
+ + {{-- Question Title --}} +
+ {{ $question->title }} +
+ + {{-- Meta --}} +
+ + Added {{ $question->created_at->diffForHumans() }} + + @if($question->level) + ยท {{ ucfirst($question->level) }} + @endif +
+ + {{-- Actions --}} +
+ + + + + + + + +
+ @csrf + @method('DELETE') + +
+
+ +
+
+
+ @endforeach +
+ + {{-- Pagination --}} +
+ {{ $questions->links() }} +
+ @else + {{-- Empty State --}} +
+
+ +
No Interview Questions Yet
+

Create your first interview question to start building your library.

+ + {{-- + + Add New Question + --}} + +
+
+ @endif + +
+@endsection diff --git a/resources/views/Users/Partials/sidebar.blade.php b/resources/views/Users/Partials/sidebar.blade.php index 51ba821..95c43a8 100644 --- a/resources/views/Users/Partials/sidebar.blade.php +++ b/resources/views/Users/Partials/sidebar.blade.php @@ -61,6 +61,13 @@ + + diff --git a/routes/web.php b/routes/web.php index d3612bd..911672f 100644 --- a/routes/web.php +++ b/routes/web.php @@ -122,6 +122,16 @@ Route::get('/{slug}/toggle-featured', [BlogController::class, 'toggleFeatured'])->name('toggle-featured'); }); + // Interview Questions Routes + Route::prefix('interview-questions')->name('interviewQuestions.')->group(function () { + Route::get('/', [\App\Http\Controllers\InterviewQuestionsController::class, 'index'])->name('index'); + Route::get('/create', [\App\Http\Controllers\InterviewQuestionsController::class, 'create'])->name('create'); + // Route::post('/', [\App\Http\Controllers\InterviewQuestionsController::class, 'store'])->name('store'); + // Route::get('/{id}/edit', [\App\Http\Controllers\InterviewQuestionsController::class, 'edit'])->name('edit'); + // Route::put('/{id}', [\App\Http\Controllers\InterviewQuestionsController::class, 'update'])->name('update'); + // Route::delete('/{id}', [\App\Http\Controllers\InterviewQuestionsController::class, 'destroy'])->name('destroy'); + }); + }); // Admin Routes