更改要从数据库中获取的列的名称

How can I change the questioned to the database which is automatically generated.I have in blade template this

{{\Illuminate\Support\Facades\Auth::user()->friends()->get()}}

and it generates

Unknown column 'friends.user_id' in 'where clause' (SQL: select * from `friends` where `friends`.`user_id` = 1 and `friends`.`user_id` is not null

because my column name is user_id1 insted user_id.

and I do not know why the query to the database takes the user_id value instead of user_id1. How can I change it ?

Define the custom foreign key in the friends relationship:

public function friends()
{
    return $this->hasMany(Friend::class, 'user_id1');
}