@ -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');
@ -3,7 +3,7 @@
<h2>Browse Threads</h2>
<div class="card card-body" v-for="thread in threads" v-bind:key="thread.id">
<p>{{ thread.creator.name }}
<h3>{{ thread.thread_title }}</h3>
<a href="./test/{ {{ thread.id }} }"><h3>{{ thread.thread_title }}</h3></a>
</div>
</template>
@ -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");