Support the ongoing development of Laravel.io →
Eloquent
Last updated 2 weeks ago.
0

you need to crete the relations on migrations first?? can you paste your migrations code??

0

I have made all the databases and relations. I'm not sure what exactly you want to see from my migration? We can take Jeffreys permission/role as example?

    public function up()
    {
        Schema::create('permission_role', function (Blueprint $table) {
            $table->integer('permission_id')->unsigned();
            $table->integer('role_id')->unsigned();
            $table->timestamps();
            $table->foreign('permission_id')->references('id')->on('permission');
            $table->foreign('role_id')->references('id')->on('role');
            $table->primary(['permission_id', 'role_id']);
            $table->engine = 'InnoDB';
        });
    }
0

Sign in to participate in this thread!

Cloudways

Your banner here too?

emilmoe emilmoe emilmoe Joined 23 Oct 2014

Moderators

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

Your logo here?

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

© 2022 Laravel.io - All rights reserved.