From 6103cf19ec0a13dcf754d917225889b096ed6fab Mon Sep 17 00:00:00 2001 From: Mohamed Jinas Date: Sat, 8 Aug 2020 20:44:59 +0500 Subject: [PATCH] Models --- app/Article.php | 44 ++++++++++++++++++++++++++++++++++++++++++++ app/Source.php | 14 ++++++++++++++ app/Topic.php | 10 ++++++++++ 3 files changed, 68 insertions(+) create mode 100644 app/Article.php create mode 100644 app/Source.php create mode 100644 app/Topic.php diff --git a/app/Article.php b/app/Article.php new file mode 100644 index 0000000..03ed312 --- /dev/null +++ b/app/Article.php @@ -0,0 +1,44 @@ +belongsTo(Source::class); + } + + public function topics() + { + return $this->belongsToMany(Topic::class); + } +} diff --git a/app/Source.php b/app/Source.php new file mode 100644 index 0000000..3cb728c --- /dev/null +++ b/app/Source.php @@ -0,0 +1,14 @@ +hasMany(Article::class); + } +} diff --git a/app/Topic.php b/app/Topic.php new file mode 100644 index 0000000..eaea39d --- /dev/null +++ b/app/Topic.php @@ -0,0 +1,10 @@ +