Update bug waiting laravel

This commit is contained in:
servdal
2025-07-17 08:13:00 +07:00
parent 8289968849
commit 9437483030
7 changed files with 65 additions and 26 deletions

View File

@@ -11,13 +11,15 @@ return new class extends Migration
*/
public function up(): void
{
Schema::create('samples', function (Blueprint $table) {
$table->id();
$table->string('patient_name', 250)->nullable();
$table->string('test_details', 255)->nullable();
$table->timestamp('created_at')->useCurrent();
$table->timestamp('updated_at')->useCurrent();
});
if (!Schema::hasTable('samples')) {
Schema::create('samples', function (Blueprint $table) {
$table->id();
$table->string('patient_name', 250)->nullable();
$table->string('test_details', 255)->nullable();
$table->timestamp('created_at')->useCurrent();
$table->timestamp('updated_at')->useCurrent();
});
}
}
/**

View File

@@ -11,16 +11,18 @@ return new class extends Migration
*/
public function up(): void
{
Schema::create('test_results', function (Blueprint $table) {
$table->id(); // ID primary key
$table->unsignedBigInteger('sample_id'); // Kolom referensi
$table->text('result'); // Kolom result
$table->string('status', 50); // Kolom status
$table->timestamp('created_at')->useCurrent();
$table->timestamp('updated_at')->useCurrent();
// Foreign key
$table->foreign('sample_id')->references('id')->on('samples')->onDelete('cascade');
});
if (!Schema::hasTable('test_results')) {
Schema::create('test_results', function (Blueprint $table) {
$table->id(); // ID primary key
$table->unsignedBigInteger('sample_id'); // Kolom referensi
$table->text('result'); // Kolom result
$table->string('status', 50); // Kolom status
$table->timestamp('created_at')->useCurrent();
$table->timestamp('updated_at')->useCurrent();
// Foreign key
$table->foreign('sample_id')->references('id')->on('samples')->onDelete('cascade');
});
}
}
/**

View File

@@ -13,8 +13,7 @@ class DatabaseSeeder extends Seeder
*/
public function run(): void
{
User::factory(10)->create();
User::factory()->create([
User::create([
'nama' => 'Administrator',
'username' => 'admin',
'password' => bcrypt('semangat'),