Transformed into pivot models and Created ResumeSlotValue
This commit is contained in:
23
database/factories/ResumeComponentInputFactory.php
Normal file
23
database/factories/ResumeComponentInputFactory.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\ResumeComponentInput>
|
||||
*/
|
||||
class ResumeComponentInputFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -13,7 +13,7 @@ return new class extends Migration
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('resume_resume_component', function (Blueprint $table) {
|
||||
Schema::create('resume_slots', function (Blueprint $table) {
|
||||
$table->id();
|
||||
|
||||
$table->foreignIdFor(Resume::class)->constrained()->onDelete('cascade');
|
||||
@@ -21,8 +21,6 @@ return new class extends Migration
|
||||
|
||||
$table->integer('order')->default(0);
|
||||
|
||||
$table->json('data')->comment('JSON structure to define the data for the resume component');
|
||||
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
@@ -32,6 +30,6 @@ return new class extends Migration
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('resume_resume_component_link');
|
||||
Schema::dropIfExists('resume_slots');
|
||||
}
|
||||
};
|
||||
@@ -14,7 +14,7 @@ return new class extends Migration
|
||||
Schema::create('resume_component_data_types', function (Blueprint $table) {
|
||||
$table->id();
|
||||
|
||||
$table->json('data_structure')->comment('JSON structure to define the data validation in laravel validation format (https://laravel.com/docs/12.x/validation#quick-writing-the-validation-logic)');
|
||||
$table->string('data_structure')->comment('valid format for the value in Laravel validation format (https://laravel.com/docs/12.x/validation#quick-writing-the-validation-logic)');
|
||||
$table->string('vue_component_name');
|
||||
|
||||
$table->timestamps();
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use App\Models\ResumeComponent;
|
||||
use App\Models\ResumeComponentDataType;
|
||||
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('resume_component_inputs', function (Blueprint $table) {
|
||||
$table->id();
|
||||
|
||||
$table->foreignIdFor(ResumeComponent::class)->constrained()->onDelete('cascade');
|
||||
$table->foreignIdFor(ResumeComponentDataType::class)->constrained()->onDelete('cascade');
|
||||
|
||||
$table->string('name');
|
||||
$table->string("placeholder");
|
||||
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('resume_component_inputs');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use App\Models\ResumeComponentInput;
|
||||
use App\Models\ResumeSlot;
|
||||
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('resume_slot_values', function (Blueprint $table) {
|
||||
$table->id();
|
||||
|
||||
$table->foreignIdFor(ResumeSlot::class);
|
||||
$table->foreignIdFor(ResumeComponentInput::class);
|
||||
|
||||
$table->string('value');
|
||||
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('resume_slot_value');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user