*/ class UserRole extends Model { protected $table = 'user_roles'; public $timestamps = false; protected $appends = ['name']; protected $fillable = ['user_id', 'role_id']; public function getNameAttribute() { return Role::getNameById($this->role_id); } }