Search | How to get data from all tables, not only one.

Posted 3 months ago by ziben69

Hello guys,

I have function search:

public function search(Request $request)
    {
        $search = $request->get('search');
        $queries = DB::table('articles')->where('header', 'like', '%'.$search.'%')->paginate(5);
        return view('pages.search', ['queries' => $queries]);
    }

How can I take more data? Now I have data from only articles table, but need in the same search for example users -> name. Thanks

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.