Update
This commit is contained in:
@@ -12,10 +12,12 @@ class ArticlesController extends Controller
|
||||
*
|
||||
* @param mixed $article
|
||||
*/
|
||||
public function show(Article $article)
|
||||
public function show($source, $guid)
|
||||
{
|
||||
return view('articles.show', [
|
||||
'article' => $article
|
||||
'article' => Article::whereHas('source', function($q) use ($source) {
|
||||
$q->where('slug', $source);
|
||||
})->where('guid', $guid)->get()->first()
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
2
public/js/app.js
vendored
2
public/js/app.js
vendored
File diff suppressed because one or more lines are too long
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"/js/app.js": "/js/app.js?id=85dc76cc267f92f13fed",
|
||||
"/js/app.js": "/js/app.js?id=3f5b2f331693f177ea0a",
|
||||
"/css/app.css": "/css/app.css?id=bbb0c2c0b76d949f1c54",
|
||||
"/js/manifest.js": "/js/manifest.js?id=3c768977c2574a34506e",
|
||||
"/js/vendor.js": "/js/vendor.js?id=968f85387c9bab0e92d2"
|
||||
|
@@ -16,7 +16,7 @@
|
||||
v-for="story in recentStories"
|
||||
:key="story.id"
|
||||
>
|
||||
<a :href="'/article/' + story.id">
|
||||
<a :href="`/article/${story.source.slug}/${story.guid}`">
|
||||
<div
|
||||
class="w-full h-auto overflow-hidden relative rounded"
|
||||
>
|
||||
@@ -25,7 +25,7 @@
|
||||
</a>
|
||||
<div class="w-full h-auto text-right overflow-hidden mt-3">
|
||||
<a
|
||||
:href="'/article/' + story.id"
|
||||
:href="`/article/${story.source.slug}/${story.guid}`"
|
||||
class="text-md leading-9 font-semibold text-right text-gray-700 py-3 MvTyper hover:underline"
|
||||
style="direction:rtl;"
|
||||
v-text="story.title"
|
||||
|
@@ -43,7 +43,7 @@
|
||||
>
|
||||
<div slot="bottom-left" class="max-w-xs">
|
||||
<div class="p-5 shadow-md m-2 mt-4">
|
||||
<a :href="'/article/' + article.id">
|
||||
<a :href="`/article/${article.source.slug}/${article.guid}`">
|
||||
<img
|
||||
class="object-scale-down h-30"
|
||||
:src="article.featured_image"
|
||||
@@ -63,7 +63,7 @@
|
||||
{{ article.published_date | dhivehiDate }}
|
||||
</p>
|
||||
|
||||
<a :href="'/article/' + article.id">
|
||||
<a :href="`/article/${article.source.slug}/${article.guid}`">
|
||||
<div
|
||||
class="text-md font-bold leading-7 mb-2 mt-1 text-gray-800 MvTyper text-right hover:underline"
|
||||
>
|
||||
|
@@ -15,7 +15,7 @@
|
||||
</div>
|
||||
<div class="flex flex-col justify-end">
|
||||
<a
|
||||
:href="'/article/' + article.id"
|
||||
:href="`/article/${article.source.slug}/${article.guid}`"
|
||||
class="text-2xl md:text-3xl lg:text-3xl leading-11 text-gray-700 pb-4 pt-4 MvTyper font-semibold hover:underline"
|
||||
style="direction:rtl;"
|
||||
v-text="article.title"
|
||||
@@ -78,7 +78,7 @@
|
||||
</div>
|
||||
<div class="flex justify-end">
|
||||
<a
|
||||
:href="'/article/' + subarticle.id"
|
||||
:href="`/article/${subarticle.source.slug}/${subarticle.guid}`"
|
||||
class="text-md leading-9 font-semibold py-3 text-gray-700 MvTyper"
|
||||
v-text="subarticle.title"
|
||||
style="direction:rtl;"
|
||||
@@ -118,7 +118,7 @@
|
||||
>
|
||||
<div class="flex justify-end">
|
||||
<a
|
||||
:href="'/article/' + listarticle.id"
|
||||
:href="`/article/${listarticle.source.slug}/${listarticle.guid}`"
|
||||
class="text-md leading-normal text-gray-800 pb-4 MvTyper text-right hover:underline"
|
||||
style="direction:rtl;"
|
||||
v-text="listarticle.title"
|
||||
|
@@ -24,7 +24,7 @@
|
||||
<div slot="bottom-left" class="max-w-xs">
|
||||
<div class="p-5 shadow-md m-2 mt-4">
|
||||
|
||||
<a href="{{route('articles.show', $article->id)}}">
|
||||
<a href="{{route('articles.show',['source' => $article->source->slug, 'guid' => $article->guid])}}">
|
||||
<img class="object-scale-down h-30" src="{{$article->featured_image}}"
|
||||
alt="{{$article->meta['title']}}">
|
||||
</a>
|
||||
@@ -32,7 +32,7 @@
|
||||
<div class="text-xs font-bold uppercase text-gray-500 text-right mt-1 mb-2 MvTyper">
|
||||
{{$article->source->name}}</div>
|
||||
|
||||
<a href="{{route('articles.show', $article->id)}}">
|
||||
<a href="{{route('articles.show',['source' => $article->source->slug, 'guid' => $article->guid])}}">
|
||||
<div class="text-md font-bold leading-7 mb-2 MvTyper text-right hover:underline">
|
||||
{{$article->title}}</div>
|
||||
</a>
|
||||
|
@@ -35,7 +35,7 @@ Route::get('/download/android', function () {
|
||||
]);
|
||||
});
|
||||
|
||||
Route::get('/article/{article:id}', [ArticlesController::class, 'show'])->name('articles.show');
|
||||
Route::get('/article/{source}/{guid}', [ArticlesController::class, 'show'])->name('articles.show');
|
||||
Route::get('/topic/{topic:slug}', [TopicsController::class, 'show'])->name('topics.show');
|
||||
Route::get('/source/{source:slug}', [SourcesController::class, 'show'])->name('sources.show');
|
||||
|
||||
|
Reference in New Issue
Block a user