From dc9fd5bc1fd6a5fef9661b34f1f9ffb739bf4355 Mon Sep 17 00:00:00 2001 From: Mohamed Jinas Date: Sat, 8 Aug 2020 23:13:10 +0500 Subject: [PATCH] Topic and article relationship --- app/Topic.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/Topic.php b/app/Topic.php index eaea39d..282fbc7 100644 --- a/app/Topic.php +++ b/app/Topic.php @@ -3,8 +3,12 @@ namespace App; use Illuminate\Database\Eloquent\Model; +use App\Article; class Topic extends Model { - // + public function articles() + { + return $this->belongsToMany(Article::class); + } }