Level 75
You need to save only path of image to the database. So string
$table->string('path');
https://laracasts.com/series/laravel-8-from-scratch/episodes/64
1 like
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi im not sure which type of data is used in laravel migrations to upload files or images. I´m not sure if i should use string. I couldn´t find any concrete information in laravels documentation, so i hope sombedy could answer me in this forum.
This is my migration that i am making:
Schema::create('detalles_tickets', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('ticket_id');
$table->foreign('ticket_id')->references('id')->on('tickets');
$table->unsignedBigInteger('product_id');
$table->foreign('product_id')->references('id')->on('products');
$table->integer('serial_number');
$table->integer('quantity');
$table->text('commentary');
$table->
$table->timestamps();
});
}
Please or to participate in this conversation.