<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreatePaymentTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('payment', function (Blueprint $table) {
            $table->id();

            $table->foreignId('customer_id')
            ->constrained('users','id')
            ->onDelete('cascade');

            $table->foreignId('seller_id')
                ->constrained('users','id')
                ->onDelete('cascade');

            $table->string('paymentable_id');
            $table->string('paymentable_type');
            $table->string('invoice_id');
            $table->string('amount');
            $table->string('gateway');
            $table->string('expert_Share');
            $table->string('site_Share');
            $table->string('seller_percent');
            $table->enum('status',\Mehrab\Payment\Models\Payment::$status);
            $table->string('ref_id')->nullable();

            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('payment');
    }
}
