Namespace server side render

This commit is contained in:
2021-01-11 19:24:44 +05:00
parent 9a3173c23a
commit 0d78b68804
2 changed files with 55 additions and 5 deletions

View File

@@ -16,8 +16,12 @@ class NameSpaceController extends Controller
{
if (!array_key_exists($namespace, config('karudhaas.topic_filters'))) return redirect('/namespaces');
return view('namespaces.show',[
'namespace' => config("karudhaas.topic_filters.".$namespace)
$options = config("karudhaas.topic_filters." . $namespace);
return view('namespaces.show', [
'options' => $options,
'articles' => Article::with('source')->whereHas('topics', function ($q) use ($options) {
$q->whereIn('slug', $options["keys"]);
})->latest('published_date')->paginate(8)
]);
}
}