diff --git a/app/Http/Controllers/API/SourcesController.php b/app/Http/Controllers/API/SourcesAPIController.php similarity index 94% rename from app/Http/Controllers/API/SourcesController.php rename to app/Http/Controllers/API/SourcesAPIController.php index cd54569..0b3532c 100644 --- a/app/Http/Controllers/API/SourcesController.php +++ b/app/Http/Controllers/API/SourcesAPIController.php @@ -9,7 +9,7 @@ use Illuminate\Http\JsonResponse; use App\Http\Resources\ArticleResource; use App\Http\Controllers\Controller; -class SourcesController extends Controller +class SourcesAPIController extends Controller { /** * Return all the avaialble Sources. diff --git a/app/Http/Controllers/API/TopicsController.php b/app/Http/Controllers/API/TopicsAPIController.php similarity index 94% rename from app/Http/Controllers/API/TopicsController.php rename to app/Http/Controllers/API/TopicsAPIController.php index 574cdbe..763103d 100644 --- a/app/Http/Controllers/API/TopicsController.php +++ b/app/Http/Controllers/API/TopicsAPIController.php @@ -9,7 +9,7 @@ use Illuminate\Http\JsonResponse; use App\Http\Resources\ArticleResource; use App\Http\Controllers\Controller; -class TopicsController extends Controller +class TopicsAPIController extends Controller { /** * Discover Topics diff --git a/app/Http/Controllers/ArticlesController.php b/app/Http/Controllers/ArticlesController.php new file mode 100644 index 0000000..6a27cb0 --- /dev/null +++ b/app/Http/Controllers/ArticlesController.php @@ -0,0 +1,21 @@ + $article->load('topics','source') + ]); + } +} diff --git a/public/js/app.js b/public/js/app.js index 5f02450..2b37010 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -20213,7 +20213,7 @@ var render = function() { "a", { staticClass: "rounded w-full flex flex-col md:flex-row mb-10", - attrs: { href: "" } + attrs: { href: "/article/" + subarticle.id } }, [ _c("div", { staticClass: "bg-white rounded px-4" }, [ @@ -20334,14 +20334,14 @@ var render = function() { "mb-4 lg:mb-0 p-4 lg:p-0 w-full md:w-4/7 relative rounded block" }, [ - _c("a", { attrs: { href: "#" } }, [ + _c("a", { attrs: { href: "/article/" + _vm.article.id } }, [ _c("img", { staticClass: "rounded-md object-cover w-full h-3/4", attrs: { src: _vm.article.featured_image } }) ]), _vm._v(" "), - _c("a", { attrs: { href: "#" } }, [ + _c("a", { attrs: { href: "/article/" + _vm.article.id } }, [ _c("h1", { staticClass: "text-gray-800 text-3xl font-bold mt-2 mb-2 leading-tigh hover:underline text-right MvTyper", diff --git a/resources/js/components/TodaysPick.vue b/resources/js/components/TodaysPick.vue index 946a243..ae85256 100644 --- a/resources/js/components/TodaysPick.vue +++ b/resources/js/components/TodaysPick.vue @@ -16,7 +16,7 @@
@@ -92,7 +92,7 @@ v-if="article" >

-
-
-
-
-

-
- -
-

-

{{article.published_date | moment('calendar')}}

-
-
-
-
- -
-

- {{paragraph}} -
-
-

- -
-
- - - - - \ No newline at end of file diff --git a/resources/views/articles/show.blade.php b/resources/views/articles/show.blade.php index b6f37bd..3a9e921 100644 --- a/resources/views/articles/show.blade.php +++ b/resources/views/articles/show.blade.php @@ -1,5 +1,34 @@ @extends('layouts.app') @section('content') - +
+
+
+
+

{{$article->title}}

+
+ +
+

{{$article->source->name}}

+

{{$article->published_date}}

+
+
+
+
+ +
+ @foreach ($article->body as $block) +

+ {{$block}} +
+
+

+ @endforeach + + +
+
@endsection \ No newline at end of file diff --git a/routes/web.php b/routes/web.php index bfeb96c..1a4294a 100644 --- a/routes/web.php +++ b/routes/web.php @@ -3,6 +3,7 @@ use Illuminate\Http\Request; use Illuminate\Support\Facades\Route; use App\Article; +use App\Http\Controllers\ArticlesController; /* |-------------------------------------------------------------------------- | Web Routes @@ -14,6 +15,12 @@ use App\Article; | */ +Route::get('/', function(){ + return view('home'); +}); + +Route::get('/article/{article:id}', [ArticlesController::class,'show'])->name('articles.show'); + Route::get('/ogimage', function(Request $request) { $article = Article::findOrFail($request->query('id')); @@ -21,6 +28,3 @@ Route::get('/ogimage', function(Request $request) { return view('ogimage', ['article' => $article]); }); -Route::get('{path}', function () { - return view('app'); -})->where('path', '(.*)'); \ No newline at end of file