Support the ongoing development of Laravel.io →
posted 1 year ago
Database
Last updated by @tomhatzer 1 year ago.
0

Hey @stevenmw I've updated the formatting in your post and you have an error in your last migration (the one for the invoices_products table).

You are using Schema::table instead of Schema::create and that is causing the Exception.

Change it to this and it should work:

    public function up()
    {
        Schema::create('invoices_products', function (Blueprint $table) {
            $table->id();
            $table->foreignId('invoice_id')->constrained('invoices');
            $table->foreignId('product_id')->constrained('products');
            $table->string('subject')->nullable();
            $table->bigInteger('price')->nullable();
            $table->bigInteger('quantity')->nullable();
        });
    }

stevenmw liked this reply

1
Solution selected by @tomhatzer

Thanks @tomhatzer its work right now

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.