Есть запрос
SELECT t1.user_id
FROM likes t1
JOIN likes t2 ON t1.user_id = t2.like_user
AND t2.user_id = 1
AND t1.like_user = 1
как мне его записать в Laravel?
пробую так
$users = DB::table(DB::raw('likes t1'))
->join(DB::raw('likes t2'), 't1.user_id', '=', 't2.like_user ')
->where('t2.user_id', '=', '1')
->where(' t1.like_user', '=', '1')->paginate(15);
но выдает
Base table or view not found: 1146 Table 'extremje_dating.DB::raw('likes t1')' doesn't exist (SQL: select count(*) as aggregate from `DB::raw('likes t1')` inner join `DB::raw('likes t2')` on `t1`.`user_id` = `t2`.`like_user ` where `t2`.`user_id` = 1 and ` t1`.`like_user` = 1)