diff --git a/app/FollowRequest.php b/app/FollowRequest.php new file mode 100644 index 000000000..2859ad4d2 --- /dev/null +++ b/app/FollowRequest.php @@ -0,0 +1,18 @@ +belongsTo(Profile::class, 'follower_id', 'id'); + } + + public function following() + { + return $this->belongsTo(Profile::class, 'following_id', 'id'); + } +} diff --git a/database/migrations/2018_09_02_042235_create_follow_requests_table.php b/database/migrations/2018_09_02_042235_create_follow_requests_table.php new file mode 100644 index 000000000..0abf52fa8 --- /dev/null +++ b/database/migrations/2018_09_02_042235_create_follow_requests_table.php @@ -0,0 +1,35 @@ +bigIncrements('id'); + $table->bigInteger('follower_id')->unsigned()->index(); + $table->bigInteger('following_id')->unsigned()->index(); + $table->boolean('is_rejected')->default(false); + $table->boolean('is_local')->default(false); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('follow_requests'); + } +}