Answer the question
In order to leave comments, you need to log in
Recreating DBAL structure on Laravel ORM?
Good afternoon, there is a structure that I built on DBAL
DBAL::createQueryBuilder()
->select('u.id_read','n.id_user')
->from('news', 'n')
->leftJoin('n', 'user', 'u', 'u.id_read = n.id_user')
->where('u.id_user = ?')
->andWhere('n.created_at > u.created_at')
->setParameters([
0 => 1,
])
->execute()->rowCount()
$laravel = App\News::join('user', 'user.id_read', '=', 'news.id_user')
->where([
['user.id_user', '=', 1],
['news.created_at', '>', 'user.created_at']
])
->count();
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question