2 months ago

hasMany on different table ?

Posted 2 months ago by untymage

I have this relation:

user hasMany invites (invites mean another user_id on the users table)

So i have a table with name of user_invites, In this table i wanna determine which user invite which user

columns: user_id and invited

The problem is hasMany doesnt apply $table argument, So how can i implement this in eloquent way ?

public function up()
    Schema::create('user_invites', function (Blueprint $table) {

Please sign in or create an account to participate in this conversation.