Bug Fixes and thiladhun scraper intergration

This commit is contained in:
2020-08-11 03:39:08 +05:00
parent 0cede5b708
commit 5df4011f13
14 changed files with 4478 additions and 137 deletions

View File

@@ -15,9 +15,8 @@ final class RecentArticles extends Controller
*/
public function __invoke()
{
return ArticleResource::collection(Article::with('source', 'topics')
return Article::with('source', 'topics')
->latest("published_date")
->paginate(8)
);
->paginate(8);
}
}

View File

@@ -18,11 +18,11 @@ class TodaysPick extends Controller
*/
public function __invoke()
{
return ArticleResource::collection(Article::with('topics', 'source')
return Article::with('topics', 'source')
->whereDate('published_date', Carbon::today())
->inRandomOrder()
->take(8)
->get()
->unique('source.name'));
->unique('source.name')->values()->toArray();
}
}