diff --git a/app/Models/Donor/Donor.php b/app/Models/Donor/Donor.php new file mode 100644 index 0000000..150d7d3 --- /dev/null +++ b/app/Models/Donor/Donor.php @@ -0,0 +1,23 @@ + Status::factory(), + 'name' => $this->faker->name(), + 'email' => $this->faker->unique()->email(), + 'full_address' => $this->faker->address(), + 'job_title' => 'Developer', + 'social_type' => $this->faker->randomElement(['twitter', 'github', 'instagram']), + 'social_url' => $this->faker->url() + ]; + } +} diff --git a/database/factories/Donor/StatusFactory.php b/database/factories/Donor/StatusFactory.php new file mode 100644 index 0000000..a517e7d --- /dev/null +++ b/database/factories/Donor/StatusFactory.php @@ -0,0 +1,17 @@ + $this->faker->name() + ]; + } +} diff --git a/database/migrations/2023_05_31_180336_create_donation_statuses_table.php b/database/migrations/2023_05_31_180336_create_donation_statuses_table.php new file mode 100644 index 0000000..92ba5f5 --- /dev/null +++ b/database/migrations/2023_05_31_180336_create_donation_statuses_table.php @@ -0,0 +1,28 @@ +id(); + $table->string('name'); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('donation_statuses'); + } +}; diff --git a/database/migrations/2023_05_31_190034_create_donors_table.php b/database/migrations/2023_05_31_190034_create_donors_table.php new file mode 100644 index 0000000..60547b8 --- /dev/null +++ b/database/migrations/2023_05_31_190034_create_donors_table.php @@ -0,0 +1,34 @@ +id(); + $table->foreignId('status_id')->constrained('donation_statuses'); + $table->string('name'); + $table->string('email'); + $table->string('full_address')->comment('City, State / Country'); + $table->string('job_title'); + $table->string('social_type')->nullable(); + $table->string('social_url')->nullable(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('donors'); + } +}; diff --git a/database/seeders/DonorStatusSeeder.php b/database/seeders/DonorStatusSeeder.php new file mode 100644 index 0000000..f32513d --- /dev/null +++ b/database/seeders/DonorStatusSeeder.php @@ -0,0 +1,22 @@ +create(['name' => $donationStatus]); + } + } +}