diff --git a/app/Console/Commands/CreateCV.php b/app/Console/Commands/CreateCV.php new file mode 100644 index 0000000..84c8f14 --- /dev/null +++ b/app/Console/Commands/CreateCV.php @@ -0,0 +1,40 @@ +argument('recipient'); + $email = $this->argument('email'); + $phone = $this->argument('phone'); + $locations = $this->argument('location'); + + CV::query() + ->create([ + // 'slug' => Str::ra, + 'recipient' => $recipient, + 'email' => $email, + 'phone-number' => $phone, + 'locations' => $locations, + ]); + + return CommandAlias::SUCCESS; + } +} diff --git a/app/Models/CV.php b/app/Models/CV.php new file mode 100644 index 0000000..5dd4c32 --- /dev/null +++ b/app/Models/CV.php @@ -0,0 +1,28 @@ + 'array', + 'views' => 'integer', + ]; +} diff --git a/database/migrations/2023_06_15_220540_create_cvs_table.php b/database/migrations/2023_06_15_220540_create_cvs_table.php new file mode 100644 index 0000000..a7560d9 --- /dev/null +++ b/database/migrations/2023_06_15_220540_create_cvs_table.php @@ -0,0 +1,28 @@ +id(); + $table->string('recipient', 255); + $table->string('email', 255); + $table->string('phone-number', 15); + $table->json('locations'); + $table->integer('views')->nullable()->default(0); + $table->timestamps(); + }); + } + + public function down(): void + { + Schema::dropIfExists('cvs'); + } +};