From 40ffaee6ed12d798070c91581ae760bac3714851 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Thu, 7 Feb 2019 00:35:38 -0700 Subject: [PATCH] Add DiscoverCategoryHashtag model --- app/DiscoverCategoryHashtag.php | 13 +++++++ .../DiscoverCategoryHashtagController.php | 10 ++++++ ...reate_discover_category_hashtags_table.php | 34 +++++++++++++++++++ 3 files changed, 57 insertions(+) create mode 100644 app/DiscoverCategoryHashtag.php create mode 100644 app/Http/Controllers/DiscoverCategoryHashtagController.php create mode 100644 database/migrations/2019_02_07_021214_create_discover_category_hashtags_table.php diff --git a/app/DiscoverCategoryHashtag.php b/app/DiscoverCategoryHashtag.php new file mode 100644 index 000000000..ff5372c23 --- /dev/null +++ b/app/DiscoverCategoryHashtag.php @@ -0,0 +1,13 @@ +bigIncrements('id'); + $table->bigInteger('discover_category_id')->unsigned()->index(); + $table->bigInteger('hashtag_id')->unsigned()->index(); + $table->unique(['discover_category_id', 'hashtag_id'], 'disc_hashtag_unique'); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('discover_category_hashtags'); + } +}