diff --git a/app/Http/Controllers/CountryController.php b/app/Http/Controllers/CountryController.php new file mode 100644 index 0000000..364ec25 --- /dev/null +++ b/app/Http/Controllers/CountryController.php @@ -0,0 +1,86 @@ + + */ +class CountryFactory extends Factory +{ + /** + * Define the model's default state. + * + * @return array + */ + public function definition() + { + return [ + // + ]; + } +} diff --git a/database/factories/MemberFactory.php b/database/factories/MemberFactory.php new file mode 100644 index 0000000..ac84abe --- /dev/null +++ b/database/factories/MemberFactory.php @@ -0,0 +1,23 @@ + + */ +class MemberFactory extends Factory +{ + /** + * Define the model's default state. + * + * @return array + */ + public function definition() + { + return [ + // + ]; + } +} diff --git a/database/migrations/10_create_countries_table.php b/database/migrations/10_create_countries_table.php new file mode 100644 index 0000000..caf2670 --- /dev/null +++ b/database/migrations/10_create_countries_table.php @@ -0,0 +1,27 @@ +id(); + $table->timestamps(); + $table->string('name'); + }); + } + + /** + * Reverse the migrations. + */ + public function down() + { + Schema::dropIfExists('countries'); + } +}; diff --git a/database/migrations/20_create_members_table.php b/database/migrations/20_create_members_table.php new file mode 100644 index 0000000..d16b632 --- /dev/null +++ b/database/migrations/20_create_members_table.php @@ -0,0 +1,36 @@ +id(); + $table->timestamps(6); + $table->string('name'); + $table->string('email'); + $table->boolean('show_email'); + $table->foreignId('country_id') + ->constrained('countries') + ->onUpdate('cascade') + ->onDelete('restrict'); + $table->string('password'); + $table->string('url')->nullable(); + $table->longText('comments')->nullable(); + }); + } + + /** + * Reverse the migrations. + */ + public function down() + { + Schema::dropIfExists('members'); + } +}; diff --git a/database/seeders/CountrySeeder.php b/database/seeders/CountrySeeder.php new file mode 100644 index 0000000..6239369 --- /dev/null +++ b/database/seeders/CountrySeeder.php @@ -0,0 +1,213 @@ +insert([ + ['name' => 'Afghanistan'], + ['name' => 'Albania'], + ['name' => 'Algeria'], + ['name' => 'Andorra'], + ['name' => 'Angola'], + ['name' => 'Antigua and Barbuda'], + ['name' => 'Argentina'], + ['name' => 'Armenia'], + ['name' => 'Australia'], + ['name' => 'Austria'], + ['name' => 'Azerbaijan'], + ['name' => 'Bahamas, The'], + ['name' => 'Bahrain'], + ['name' => 'Bangladesh'], + ['name' => 'Barbados'], + ['name' => 'Belarus'], + ['name' => 'Belgium'], + ['name' => 'Belize'], + ['name' => 'Benin'], + ['name' => 'Bolivia'], + ['name' => 'Bosnia and Herzegovina'], + ['name' => 'Botswana'], + ['name' => 'Brazil'], + ['name' => 'Brunei'], + ['name' => 'Bulgaria'], + ['name' => 'Burkina Faso'], + ['name' => 'Burundi'], + ['name' => 'Cabo Verde'], + ['name' => 'Cambodia'], + ['name' => 'Cameroon'], + ['name' => 'Canada'], + ['name' => 'Central African Republic (CAR)'], + ['name' => 'Chad'], + ['name' => 'Chile'], + ['name' => 'China'], + ['name' => 'Colombia'], + ['name' => 'Comoros'], + ['name' => 'Congo, Democratic Republic of the'], + ['name' => 'Congo, Republic of the'], + ['name' => 'Costa Rica'], + ['name' => "Cote d'Ivoire"], + ['name' => 'Croatia'], + ['name' => 'Cuba'], + ['name' => 'Cyprus'], + ['name' => 'Czechia'], + ['name' => 'Denmark'], + ['name' => 'Djibouti'], + ['name' => 'Dominica'], + ['name' => 'Dominican Republic'], + ['name' => 'Ecuador'], + ['name' => 'Egypt'], + ['name' => 'El Salvador'], + ['name' => 'Equatorial Guinea'], + ['name' => 'Eritrea'], + ['name' => 'Estonia'], + ['name' => 'Eswatini'], + ['name' => 'Ethiopia'], + ['name' => 'Fiji'], + ['name' => 'Finland'], + ['name' => 'France'], + ['name' => 'Gabon'], + ['name' => 'Gambia'], + ['name' => 'Georgia'], + ['name' => 'Germany'], + ['name' => 'Ghana'], + ['name' => 'Greece'], + ['name' => 'Grenada'], + ['name' => 'Guatemala'], + ['name' => 'Guinea'], + ['name' => 'Guinea-Bissau'], + ['name' => 'Guyana'], + ['name' => 'Haiti'], + ['name' => 'Honduras'], + ['name' => 'Hungary'], + ['name' => 'Iceland'], + ['name' => 'India'], + ['name' => 'Indonesia'], + ['name' => 'Iran'], + ['name' => 'Iraq'], + ['name' => 'Ireland'], + ['name' => 'Italy'], + ['name' => 'Jamaica'], + ['name' => 'Japan'], + ['name' => 'Jordan'], + ['name' => 'Kazakhstan'], + ['name' => 'Kenya'], + ['name' => 'Kiribati'], + ['name' => 'Kosovo'], + ['name' => 'Kuwait'], + ['name' => 'Kyrgyzstan'], + ['name' => 'Laos'], + ['name' => 'Latvia'], + ['name' => 'Lebanon'], + ['name' => 'Lesotho'], + ['name' => 'Liberia'], + ['name' => 'Libya'], + ['name' => 'Liechtenstein'], + ['name' => 'Lithuania'], + ['name' => 'Luxembourg'], + ['name' => 'Madagascar'], + ['name' => 'Malawi'], + ['name' => 'Malaysia'], + ['name' => 'Maldives'], + ['name' => 'Mali'], + ['name' => 'Malta'], + ['name' => 'Marshall Islands'], + ['name' => 'Mauritania'], + ['name' => 'Mauritius'], + ['name' => 'Mexico'], + ['name' => 'Micronesia'], + ['name' => 'Moldova'], + ['name' => 'Monaco'], + ['name' => 'Mongolia'], + ['name' => 'Montenegro'], + ['name' => 'Morocco'], + ['name' => 'Mozambique'], + ['name' => 'Myanmar'], + ['name' => 'Nambia'], + ['name' => 'Nauru'], + ['name' => 'Nepal'], + ['name' => 'Netherlands'], + ['name' => 'New Zealand'], + ['name' => 'Nicaragua'], + ['name' => 'Niger'], + ['name' => 'Nigeria'], + ['name' => 'North Korea'], + ['name' => 'North Macedonia'], + ['name' => 'Norway'], + ['name' => 'Oman'], + ['name' => 'Pakistan'], + ['name' => 'Palau'], + ['name' => 'Palestine'], + ['name' => 'Panama'], + ['name' => 'Papua New Guinea'], + ['name' => 'Paraguay'], + ['name' => 'Peru'], + ['name' => 'Philippines'], + ['name' => 'Poland'], + ['name' => 'Portugal'], + ['name' => 'Qatar'], + ['name' => 'Romania'], + ['name' => 'Russia'], + ['name' => 'Rwanda'], + ['name' => 'Saint Kitts and Nevis'], + ['name' => 'Saint Lucia'], + ['name' => 'Saint Vincent and the Grenadines'], + ['name' => 'Samoa'], + ['name' => 'San Marino'], + ['name' => 'Sao Tome and Principe'], + ['name' => 'Saudi Arabia'], + ['name' => 'Senegal'], + ['name' => 'Serbia'], + ['name' => 'Seychelles'], + ['name' => 'Sierra Leone'], + ['name' => 'Singapore'], + ['name' => 'Slovakia'], + ['name' => 'Slovenia'], + ['name' => 'Solomon Islands'], + ['name' => 'Somalia'], + ['name' => 'South Africa'], + ['name' => 'South Korea'], + ['name' => 'South Sudan'], + ['name' => 'Spain'], + ['name' => 'Sri Lanka'], + ['name' => 'Sudan'], + ['name' => 'Suriname'], + ['name' => 'Sweden'], + ['name' => 'Switzerland'], + ['name' => 'Syria'], + ['name' => 'Taiwan'], + ['name' => 'Tajikistan'], + ['name' => 'Tanzania'], + ['name' => 'Thailand'], + ['name' => 'Timor-Leste'], + ['name' => 'Togo'], + ['name' => 'Tonga'], + ['name' => 'Trinidad and Tobago'], + ['name' => 'Tunisia'], + ['name' => 'Turkey'], + ['name' => 'Turkmenistan'], + ['name' => 'Tuvalu'], + ['name' => 'Uganda'], + ['name' => 'Ukraine'], + ['name' => 'United Arab Emirates (UAE)'], + ['name' => 'United Kingdom (UK)'], + ['name' => 'United States of America (USA)'], + ['name' => 'Uruguay'], + ['name' => 'Uzbekistan'], + ['name' => 'Vanuatu'], + ['name' => 'Vatican City (Holy See)'], + ['name' => 'Venezuela'], + ['name' => 'Vietnam'], + ['name' => 'Yemen'], + ['name' => 'Zambia'], + ['name' => 'Zimbabwe'], + ]); + } +} diff --git a/database/seeders/DatabaseSeeder.php b/database/seeders/DatabaseSeeder.php index d1a6da9..59fa849 100644 --- a/database/seeders/DatabaseSeeder.php +++ b/database/seeders/DatabaseSeeder.php @@ -25,6 +25,8 @@ public function run() CategorySeeder::class, JoinedSeeder::class, OwnedSeeder::class, + CountrySeeder::class, + MemberSeeder::class, ]); } } diff --git a/database/seeders/MemberSeeder.php b/database/seeders/MemberSeeder.php new file mode 100644 index 0000000..5ba752f --- /dev/null +++ b/database/seeders/MemberSeeder.php @@ -0,0 +1,19 @@ +