diff --git a/app/Http/Controllers/DataSoalController.php b/app/Http/Controllers/DataSoalController.php new file mode 100644 index 0000000..933f73b --- /dev/null +++ b/app/Http/Controllers/DataSoalController.php @@ -0,0 +1,64 @@ +route('dashboard.index'); + return redirect()->route('beranda.index'); } - - return redirect()->route('beranda.index'); + return redirect()->route('dashboard.index'); } return $next($request); } diff --git a/app/Models/DataSoalModel.php b/app/Models/DataSoalModel.php new file mode 100644 index 0000000..e63d76c --- /dev/null +++ b/app/Models/DataSoalModel.php @@ -0,0 +1,10 @@ +id(); + $table->uuid('id_user')->unique(); $table->string('name'); $table->string('email')->unique(); $table->timestamp('email_verified_at')->nullable(); diff --git a/database/migrations/2026_03_11_223453_add_column_in_users_table.php b/database/migrations/2026_03_11_223453_add_column_in_users_table.php new file mode 100644 index 0000000..e47361c --- /dev/null +++ b/database/migrations/2026_03_11_223453_add_column_in_users_table.php @@ -0,0 +1,30 @@ +date('tgl_lahir')->nullable()->after('role'); + $table->string('alamat')->after('tgl_lahir'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('users', function (Blueprint $table) { + $table->dropColumn('tgl_lahir'); + $table->dropColumn('alamat'); + }); + } +}; diff --git a/database/migrations/2026_03_11_223941_create_test_table.php b/database/migrations/2026_03_11_223941_create_test_table.php new file mode 100644 index 0000000..77f7f7a --- /dev/null +++ b/database/migrations/2026_03_11_223941_create_test_table.php @@ -0,0 +1,31 @@ +uuid('id_test')->primary(); + $table->uuid('id_user'); + $table->timestamps(); + + // Foreign Key + $table->foreign('id_user')->references('id_user')->on('users')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('test'); + } +}; diff --git a/database/migrations/2026_03_11_225330_create_detail_test_table.php b/database/migrations/2026_03_11_225330_create_detail_test_table.php new file mode 100644 index 0000000..ae85f25 --- /dev/null +++ b/database/migrations/2026_03_11_225330_create_detail_test_table.php @@ -0,0 +1,33 @@ +uuid('id_detail_test')->primary(); + $table->uuid('id_soal'); + $table->uuid('id_test'); + $table->enum('jawaban', ['a', 'b', 'c', 'd', 'e', 'null']); + $table->timestamps(); + + // Foreign Key + $table->foreign('id_test')->references('id_test')->on('test')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('detail_test'); + } +}; diff --git a/database/migrations/2026_03_11_230140_create_soal_table.php b/database/migrations/2026_03_11_230140_create_soal_table.php new file mode 100644 index 0000000..2db2b8b --- /dev/null +++ b/database/migrations/2026_03_11_230140_create_soal_table.php @@ -0,0 +1,34 @@ +uuid('id_soal')->primary(); + $table->string('pertanyaan'); + $table->string('jawaban_a'); + $table->string('jawaban_b'); + $table->string('jawaban_c'); + $table->string('jawaban_d'); + $table->string('jawaban_e'); + $table->enum('jawaban_benar', ['a', 'b', 'c', 'd', 'e']); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('soal'); + } +}; diff --git a/database/seeders/DatabaseSeeder.php b/database/seeders/DatabaseSeeder.php index 4b393cc..529d074 100644 --- a/database/seeders/DatabaseSeeder.php +++ b/database/seeders/DatabaseSeeder.php @@ -5,6 +5,7 @@ use App\Models\User; use Illuminate\Database\Console\Seeds\WithoutModelEvents; use Illuminate\Database\Seeder; +use Illuminate\Support\Str; class DatabaseSeeder extends Seeder { @@ -18,24 +19,30 @@ public function run(): void // User::factory(10)->create(); User::factory()->create([ + 'id_user' => Str::uuid(), 'name' => 'Test Admin', 'email' => 'admin@gmail.com', 'password' => password_hash('admin1234', PASSWORD_BCRYPT, ['cost' => 12]), 'role' => 'admin', + 'alamat' => 'Jember' ]); User::factory()->create([ + 'id_user' => Str::uuid(), 'name' => 'Test Psikolog', 'email' => 'psikolog@gmail.com', 'password' => password_hash('psikolog1234', PASSWORD_BCRYPT, ['cost' => 12]), 'role' => 'psikolog', + 'alamat' => 'Jember' ]); User::factory()->create([ + 'id_user' => Str::uuid(), 'name' => 'Test User', 'email' => 'user@gmail.com', 'password' => password_hash('user1234', PASSWORD_BCRYPT, ['cost' => 12]), 'role' => 'user', + 'alamat' => 'Jember' ]); } } diff --git a/resources/views/admin/layouts/sidebar.blade.php b/resources/views/admin/layouts/sidebar.blade.php index 7315ade..ec149cd 100644 --- a/resources/views/admin/layouts/sidebar.blade.php +++ b/resources/views/admin/layouts/sidebar.blade.php @@ -30,13 +30,13 @@ @if(Auth::user()->role == 'psikolog')
| No | +Dummy | +Dummy | +Dummy | +Aksi | +
|---|---|---|---|---|
| 1 | +lorem | +lorem | +lorem | +
+
+
+
+
+ |
+
| No | +Dummy | +Dummy | +Dummy | +Aksi | +
|---|---|---|---|---|
| 1 | +lorem | +lorem | +lorem | +
+
+
+
+
+ |
+