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"); +});