diff --git a/app/Http/Controllers/NameSpaceController.php b/app/Http/Controllers/NameSpaceController.php index bf6cc92..7f094be 100644 --- a/app/Http/Controllers/NameSpaceController.php +++ b/app/Http/Controllers/NameSpaceController.php @@ -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) ]); } } diff --git a/resources/views/namespaces/show.blade.php b/resources/views/namespaces/show.blade.php index 45cb079..fa54cd0 100644 --- a/resources/views/namespaces/show.blade.php +++ b/resources/views/namespaces/show.blade.php @@ -1,5 +1,51 @@ - - + +
+
+

+ {{$options['dv_name']}}

+ +
+ +
+ +
+
+ + @foreach ($articles as $article) +
+ +
+ +
+
+
+ {{$article->title}} + +

+ {{$article->published_date->locale('dv')->isoFormat('Do MMMM YYYY')}} +

+
+ + +
+ @endforeach +
+
+
+
\ No newline at end of file