Support the ongoing development of Laravel.io →
posted 2 months ago
Database
Last updated by @tomhatzer 2 months ago.
0
moderator Solution

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();
        });
    }
1
Solution selected by @tomhatzer

Thanks @tomhatzer its work right now

0

Sign in to participate in this thread!

LoadForge

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.

© 2023 Laravel.io - All rights reserved.