For example,
there are two tables articles_1
and articles_2
,they have the same fields:
id
title
content
slug
When there is one table, I can query an article like this:
public function show($slug)
{
$article = Article::findOrFail($slug);
return view('show', compact('article'));
}
Now there are two tables,I want to query an article,how to write the code?