I have three tables in laravel5.6 vuejs2 application
- Feed (id, message, created_at, updated_at, created_by, updated_by)
- Classifieds (id, category_id, title, description, keywords, created_at, updated_at, created_by, updated_by)
- News (id, title, subtitle, content, keywords, created_at, created_by, updated_at, updated_by).
I want to create a backend like facebook where i can list all the latest posts as stories. In this case i want to post feed, classifieds and news with load more button. How to achieve this?
$feed = Feed::latest()->paginate(10);
$classifieds = Classifieds::latest()->paginate(10);
$news = News::latest()->paginate(10);
$stories = array_merge(['feed', 'classifieds', 'news']);
this doesn't work and i know this is not the right way to do. I'm a learner in laravel and did not find much help on this.
Could anyone tell me how to do this so that i can list all the three tables which are not related on the dashboard page as latest stories.