Multiple Image and Featured Image

Good evening, I wanted to have a pet details with pet avatar and some the pets related gallery. Any advice how to achieve this ? Im planning to have max 5 images uploading into the pet record, but im stuck how to choose 1 image out of the 5 for the pet avatar ?
pets table

Schema::create('pets', function (Blueprint $table) {
$table->uuid('id')->primary();
$table->string('name');
$table->date('birth_of_date');
$table->string('breed');
$table->string('gender');
$table->string('size')->nullable();
$table->string('tags');
$table->integer('age')->nullable();
$table->string('gallery')->nullable();
$table->text('description');
$table->timestamps();
$table->softDeletes();
});
pets table

Schema::create('pets', function (Blueprint $table) {
$table->uuid('id')->primary();
$table->string('name');
$table->date('birth_of_date');
$table->string('breed');
$table->string('gender');
$table->string('size')->nullable();
$table->string('tags');
$table->integer('age')->nullable();
$table->string('gallery')->nullable();
$table->text('description');
$table->timestamps();
$table->softDeletes();
});
Im thinking about changing the $table->string('gallery')->nullable(); into $table->string('avatar')->nullable(); and make a separate table called pet_image.
0 Replies
No replies yetBe the first to reply to this messageJoin