<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class Assignment extends Model
{
    protected $fillable = ['role_id', 'user_id',];
    
    public function roles()
    {
        return $this->belongsTo('app\Role');
    }

    public function users()
    {
        return $this->belongsTo('app\User');
    }
}

<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class Assignment extends Model
{
    protected $fillable = ['role_id', 'user_id',];
    
    public function role()
    {
        return $this->belongsTo('app\Role');
    }

    public function user()
    {
        return $this->belongsTo('app\User');
    }
}

Create relationship for assignments table
refactor(assignments): Create relationship for assignments table

modifield:   app/Assignment.php

see #107
