From d07c3deb86306e1c712d9dcafeeec6755b1eece7 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sat, 6 Jul 2019 20:51:23 -0600 Subject: [PATCH] Add HashtagFollow model, migration and controller --- app/HashtagFollow.php | 10 ++++++ .../Controllers/HashtagFollowController.php | 10 ++++++ ...05_034644_create_hashtag_follows_table.php | 35 +++++++++++++++++++ 3 files changed, 55 insertions(+) create mode 100644 app/HashtagFollow.php create mode 100644 app/Http/Controllers/HashtagFollowController.php create mode 100644 database/migrations/2019_07_05_034644_create_hashtag_follows_table.php diff --git a/app/HashtagFollow.php b/app/HashtagFollow.php new file mode 100644 index 000000000..5258520d6 --- /dev/null +++ b/app/HashtagFollow.php @@ -0,0 +1,10 @@ +bigIncrements('id'); + $table->bigInteger('user_id')->unsigned()->index(); + $table->bigInteger('profile_id')->unsigned()->index(); + $table->bigInteger('hashtag_id')->unsigned()->index(); + $table->unique(['user_id', 'profile_id', 'hashtag_id']); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('hashtag_follows'); + } +}