when I do this
$category = NewsCategory::whereSlug($slug)->with('news.category:id,title,slug')->firstOrFail(); then I have following queries
select * from `news_categories` where `slug` = 'novinki' limit 1 select * from `news_posts` where `news_posts`.`category_id` in (2) and `news_posts`.`deleted_at` is null select `id`, `title`, `slug` from `news_categories` where `news_categories`.`id` in (2) but I want to load specific columns on first news relation also and I have error if I do like this
$category = NewsCategory::whereSlug($slug)->with('news:id,title,image.category:id,title,slug')->firstOrFail(); what is the correct way to get this query?
select * from `news_categories` where `slug` = 'novinki' limit 1 select `id`, `title`, `image` from `news_posts` where `news_posts`.`category_id` in (2) and `news_posts`.`deleted_at` is null select `id`, `title`, `slug` from `news_categories` where `news_categories`.`id` in (2)```