From 19b4882007bc33224205fc6cc22fba33b2fe1e3b Mon Sep 17 00:00:00 2001 From: Braydon Kains Date: Mon, 1 Apr 2019 15:19:35 -0400 Subject: [PATCH] slight changes --- app/Post.php | 7 +++++++ resources/js/components/ThreadComponent.vue | 2 +- routes/web.php | 4 ++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/app/Post.php b/app/Post.php index f76dd9e..e11db2d 100644 --- a/app/Post.php +++ b/app/Post.php @@ -12,4 +12,11 @@ class Post extends Model public function poster() { return $this->belongsTo('App\User', 'poster_id'); } + + /** + * Get the poster of the post. + */ + public function thread() { + return $this->belongsTo('App\Thread'); + } } diff --git a/resources/js/components/ThreadComponent.vue b/resources/js/components/ThreadComponent.vue index c5358fa..06a3ff8 100644 --- a/resources/js/components/ThreadComponent.vue +++ b/resources/js/components/ThreadComponent.vue @@ -3,7 +3,7 @@

Browse Threads

{{ thread.creator.name }} -

{{ thread.thread_title }}

+

{{ thread.thread_title }}

diff --git a/routes/web.php b/routes/web.php index fabafef..c740baa 100644 --- a/routes/web.php +++ b/routes/web.php @@ -22,3 +22,7 @@ Route::get('/home', 'HomeController@index')->name('home'); Route::get('/test', function() { return view("dashboard"); }); + +Route::get('/test/{id}', function() { + return view("thread"); +});