I tried to get books.id and authors.Name in an array using leftJoin() in Yii2.
$data = Book::find()
->select("authors.Name, books.id")
->leftJoin("authors", "authors.book_id = books.id")
->where(['books.id' => '14,16,17,18'])
->all();
But this result is only from books table. I can not see authors.Name in this result.
In Laravel, it is easy to get the data like the above. Is it not possible in Yii2?