country + status added and other changes
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('countries', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('title');
|
||||
$table->string('country_flag')->nullable();
|
||||
$table->boolean('status')->default(true);
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('countries');
|
||||
}
|
||||
};
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('registrations', function (Blueprint $table) {
|
||||
$table->unsignedBigInteger('country_id')->nullable();
|
||||
$table->enum('status', ['hot', 'warm', 'cold'])->default('warm');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('registrations', function (Blueprint $table) {
|
||||
$table->dropColumn(['country_id', 'status']);
|
||||
});
|
||||
|
||||
}
|
||||
};
|
||||
@@ -15,11 +15,14 @@ class DatabaseSeeder extends Seeder
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
$this->call([
|
||||
countries_seeder::class,
|
||||
]);
|
||||
// User::factory(10)->create();
|
||||
|
||||
User::factory()->create([
|
||||
'name' => 'Test User',
|
||||
'email' => 'test@example.com',
|
||||
]);
|
||||
// User::factory()->create([
|
||||
// 'name' => 'Test User',
|
||||
// 'email' => 'test@example.com',
|
||||
// ]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,309 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class countries_seeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
DB::table('countries')->truncate();
|
||||
|
||||
DB::table('countries')->insert([
|
||||
[
|
||||
'id' => 1,
|
||||
'title' => 'United States',
|
||||
'country_flag' => 'https://flagcdn.com/w80/us.png',
|
||||
'status' => 1,
|
||||
],
|
||||
[
|
||||
'id' => 2,
|
||||
'title' => 'Mexico',
|
||||
'country_flag' => 'https://flagcdn.com/w80/mx.png',
|
||||
'status' => 1,
|
||||
],
|
||||
[
|
||||
'id' => 3,
|
||||
'title' => 'Canada',
|
||||
'country_flag' => 'https://flagcdn.com/w80/ca.png',
|
||||
'status' => 1,
|
||||
],
|
||||
[
|
||||
'id' => 4,
|
||||
'title' => 'Japan',
|
||||
'country_flag' => 'https://flagcdn.com/w80/jp.png',
|
||||
'status' => 1,
|
||||
],
|
||||
[
|
||||
'id' => 5,
|
||||
'title' => 'Iran',
|
||||
'country_flag' => 'https://flagcdn.com/w80/ir.png',
|
||||
'status' => 1,
|
||||
],
|
||||
[
|
||||
'id' => 6,
|
||||
'title' => 'South Korea',
|
||||
'country_flag' => 'https://flagcdn.com/w80/kr.png',
|
||||
'status' => 1,
|
||||
],
|
||||
[
|
||||
'id' => 7,
|
||||
'title' => 'Australia',
|
||||
'country_flag' => 'https://flagcdn.com/w80/au.png',
|
||||
'status' => 1,
|
||||
],
|
||||
[
|
||||
'id' => 8,
|
||||
'title' => 'Saudi Arabia',
|
||||
'country_flag' => 'https://flagcdn.com/w80/sa.png',
|
||||
'status' => 1,
|
||||
],
|
||||
[
|
||||
'id' => 9,
|
||||
'title' => 'Qatar',
|
||||
'country_flag' => 'https://flagcdn.com/w80/qa.png',
|
||||
'status' => 1,
|
||||
],
|
||||
[
|
||||
'id' => 10,
|
||||
'title' => 'Uzbekistan',
|
||||
'country_flag' => 'https://flagcdn.com/w80/uz.png',
|
||||
'status' => 1,
|
||||
],
|
||||
[
|
||||
'id' => 11,
|
||||
'title' => 'Jordan',
|
||||
'country_flag' => 'https://flagcdn.com/w80/jo.png',
|
||||
'status' => 1,
|
||||
],
|
||||
[
|
||||
'id' => 12,
|
||||
'title' => 'Iraq',
|
||||
'country_flag' => 'https://flagcdn.com/w80/iq.png',
|
||||
'status' => 1,
|
||||
],
|
||||
[
|
||||
'id' => 13,
|
||||
'title' => 'Argentina',
|
||||
'country_flag' => 'countries/ZQLg2ALI9Ez25ZqiFA2u5LRox2lmn66MOkr9Ywqr.png',
|
||||
'status' => 1,
|
||||
],
|
||||
[
|
||||
'id' => 14,
|
||||
'title' => 'Brazil',
|
||||
'country_flag' => 'https://flagcdn.com/w80/br.png',
|
||||
'status' => 1,
|
||||
],
|
||||
[
|
||||
'id' => 15,
|
||||
'title' => 'Uruguay',
|
||||
'country_flag' => 'https://flagcdn.com/w80/uy.png',
|
||||
'status' => 1,
|
||||
],
|
||||
[
|
||||
'id' => 16,
|
||||
'title' => 'Colombia',
|
||||
'country_flag' => 'https://flagcdn.com/w80/co.png',
|
||||
'status' => 1,
|
||||
],
|
||||
[
|
||||
'id' => 17,
|
||||
'title' => 'Ecuador',
|
||||
'country_flag' => 'https://flagcdn.com/w80/ec.png',
|
||||
'status' => 1,
|
||||
],
|
||||
[
|
||||
'id' => 18,
|
||||
'title' => 'Paraguay',
|
||||
'country_flag' => 'https://flagcdn.com/w80/py.png',
|
||||
'status' => 1,
|
||||
],
|
||||
[
|
||||
'id' => 19,
|
||||
'title' => 'New Zealand',
|
||||
'country_flag' => 'https://flagcdn.com/w80/nz.png',
|
||||
'status' => 1,
|
||||
],
|
||||
[
|
||||
'id' => 20,
|
||||
'title' => 'Morocco',
|
||||
'country_flag' => 'https://flagcdn.com/w80/ma.png',
|
||||
'status' => 1,
|
||||
],
|
||||
[
|
||||
'id' => 21,
|
||||
'title' => 'Senegal',
|
||||
'country_flag' => 'https://flagcdn.com/w80/sn.png',
|
||||
'status' => 1,
|
||||
],
|
||||
[
|
||||
'id' => 22,
|
||||
'title' => 'Egypt',
|
||||
'country_flag' => 'https://flagcdn.com/w80/eg.png',
|
||||
'status' => 1,
|
||||
],
|
||||
[
|
||||
'id' => 23,
|
||||
'title' => 'Algeria',
|
||||
'country_flag' => 'https://flagcdn.com/w80/dz.png',
|
||||
'status' => 1,
|
||||
],
|
||||
[
|
||||
'id' => 24,
|
||||
'title' => 'Tunisia',
|
||||
'country_flag' => 'https://flagcdn.com/w80/tn.png',
|
||||
'status' => 1,
|
||||
],
|
||||
[
|
||||
'id' => 25,
|
||||
'title' => 'South Africa',
|
||||
'country_flag' => 'https://flagcdn.com/w80/za.png',
|
||||
'status' => 1,
|
||||
],
|
||||
[
|
||||
'id' => 26,
|
||||
'title' => 'Ivory Coast',
|
||||
'country_flag' => 'https://flagcdn.com/w80/ci.png',
|
||||
'status' => 1,
|
||||
],
|
||||
[
|
||||
'id' => 27,
|
||||
'title' => 'Ghana',
|
||||
'country_flag' => 'https://flagcdn.com/w80/gh.png',
|
||||
'status' => 1,
|
||||
],
|
||||
[
|
||||
'id' => 28,
|
||||
'title' => 'Cape Verde',
|
||||
'country_flag' => 'https://flagcdn.com/w80/cv.png',
|
||||
'status' => 1,
|
||||
],
|
||||
[
|
||||
'id' => 29,
|
||||
'title' => 'DR Congo',
|
||||
'country_flag' => 'https://flagcdn.com/w80/cd.png',
|
||||
'status' => 1,
|
||||
],
|
||||
[
|
||||
'id' => 30,
|
||||
'title' => 'England',
|
||||
'country_flag' => 'https://upload.wikimedia.org/wikipedia/en/thumb/b/be/Flag_of_England.svg/120px-Flag_of_England.svg.png',
|
||||
'status' => 1,
|
||||
],
|
||||
[
|
||||
'id' => 31,
|
||||
'title' => 'France',
|
||||
'country_flag' => 'https://flagcdn.com/w80/fr.png',
|
||||
'status' => 1,
|
||||
],
|
||||
[
|
||||
'id' => 32,
|
||||
'title' => 'Spain',
|
||||
'country_flag' => 'https://flagcdn.com/w80/es.png',
|
||||
'status' => 1,
|
||||
],
|
||||
[
|
||||
'id' => 33,
|
||||
'title' => 'Germany',
|
||||
'country_flag' => 'https://flagcdn.com/w80/de.png',
|
||||
'status' => 1,
|
||||
],
|
||||
[
|
||||
'id' => 34,
|
||||
'title' => 'Portugal',
|
||||
'country_flag' => 'https://flagcdn.com/w80/pt.png',
|
||||
'status' => 1,
|
||||
],
|
||||
[
|
||||
'id' => 35,
|
||||
'title' => 'Netherlands',
|
||||
'country_flag' => 'https://flagcdn.com/w80/nl.png',
|
||||
'status' => 1,
|
||||
],
|
||||
[
|
||||
'id' => 36,
|
||||
'title' => 'Belgium',
|
||||
'country_flag' => 'https://flagcdn.com/w80/be.png',
|
||||
'status' => 1,
|
||||
],
|
||||
[
|
||||
'id' => 37,
|
||||
'title' => 'Croatia',
|
||||
'country_flag' => 'https://flagcdn.com/w80/hr.png',
|
||||
'status' => 1,
|
||||
],
|
||||
[
|
||||
'id' => 38,
|
||||
'title' => 'Switzerland',
|
||||
'country_flag' => 'https://flagcdn.com/w80/ch.png',
|
||||
'status' => 1,
|
||||
],
|
||||
[
|
||||
'id' => 39,
|
||||
'title' => 'Austria',
|
||||
'country_flag' => 'https://flagcdn.com/w80/at.png',
|
||||
'status' => 1,
|
||||
],
|
||||
[
|
||||
'id' => 40,
|
||||
'title' => 'Scotland',
|
||||
'country_flag' => 'https://upload.wikimedia.org/wikipedia/commons/thumb/1/10/Flag_of_Scotland.svg/120px-Flag_of_Scotland.svg.png',
|
||||
'status' => 1,
|
||||
],
|
||||
[
|
||||
'id' => 41,
|
||||
'title' => 'Norway',
|
||||
'country_flag' => 'https://flagcdn.com/w80/no.png',
|
||||
'status' => 1,
|
||||
],
|
||||
[
|
||||
'id' => 42,
|
||||
'title' => 'Bosnia and Herzegovina',
|
||||
'country_flag' => 'https://flagcdn.com/w80/ba.png',
|
||||
'status' => 1,
|
||||
],
|
||||
[
|
||||
'id' => 43,
|
||||
'title' => 'Sweden',
|
||||
'country_flag' => 'https://flagcdn.com/w80/se.png',
|
||||
'status' => 1,
|
||||
],
|
||||
[
|
||||
'id' => 44,
|
||||
'title' => 'Türkiye',
|
||||
'country_flag' => 'https://flagcdn.com/w80/tr.png',
|
||||
'status' => 1,
|
||||
],
|
||||
[
|
||||
'id' => 45,
|
||||
'title' => 'Czechia',
|
||||
'country_flag' => 'https://flagcdn.com/w80/cz.png',
|
||||
'status' => 1,
|
||||
],
|
||||
[
|
||||
'id' => 46,
|
||||
'title' => 'Panama',
|
||||
'country_flag' => 'https://flagcdn.com/w80/pa.png',
|
||||
'status' => 1,
|
||||
],
|
||||
[
|
||||
'id' => 47,
|
||||
'title' => 'Curaçao',
|
||||
'country_flag' => 'https://flagcdn.com/w80/cw.png',
|
||||
'status' => 1,
|
||||
],
|
||||
[
|
||||
'id' => 48,
|
||||
'title' => 'Haiti',
|
||||
'country_flag' => 'https://flagcdn.com/w80/ht.png',
|
||||
'status' => 1,
|
||||
],
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user