diff --git a/app/Models/Post.php b/app/Models/Post.php new file mode 100644 index 0000000..089656b --- /dev/null +++ b/app/Models/Post.php @@ -0,0 +1,11 @@ + + */ +class PostFactory extends Factory +{ + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + // + ]; + } +} diff --git a/database/migrations/2024_08_21_011536_create_posts_table.php b/database/migrations/2024_08_21_011536_create_posts_table.php new file mode 100644 index 0000000..82ab2aa --- /dev/null +++ b/database/migrations/2024_08_21_011536_create_posts_table.php @@ -0,0 +1,33 @@ +id(); + + $table->string("title"); + $table->text("description"); + $table->string("image"); + $table->foreignId("user_id")->constrained()->onDelete("cascade"); + + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('posts'); + } +};