Ambiguous "id" column on Edit Page

Hello, i have a custom query on resource, my problem on edit page, two table with inner joined,
both table have "id" column, edit page add "WHERE" query on "id" column, this is causing the error.

How to change "WHERE id" to "WHERE users.id" ?

    public static function getEloquentQuery(): Builder
    {
        $authUser = Auth::guard('admin')->user();
        //$branch = Branch::where('corp_id',$authUser->corp_id)->first();

        if ($authUser->is_owner) {
            // NOTE : Inner join bug on this line
            return static::getModel()::query()
            ->select('branches.id AS branch_id','branches.title AS branch_title','users.*')
            ->join('branches', 'branches.id', '=', 'users.branch_id')
            ->where('corp_id',$authUser->corp_id);
        }

        return static::getModel()::query()->where('branch_id',3);
    }
testphoto.png
Was this page helpful?