Edit File: 2023_11_07_130636_create_rates_table.php
<?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('rates', function (Blueprint $table) { $table->id(); $table->integer('rate'); $table->text('message')->nullable(); $table->morphs('ratingable'); // the person that made the rate $table->morphs('ratedable'); // the person that received the rate $table->foreignId('order_id')->nullable()->constrained()->onDelete('cascade'); $table->timestamps(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('rates'); } };
Back to File Manager