4 changed files with 79 additions and 4 deletions
-
17app/Http/Controllers/FamilyActionsController.php
-
27app/User.php
-
35database/migrations/2021_03_28_091809_create_family_member_connections_table.php
-
4tests/Feature/ManageUserFamiliesTest.php
@ -0,0 +1,35 @@ |
|||
<?php |
|||
|
|||
use Illuminate\Database\Migrations\Migration; |
|||
use Illuminate\Database\Schema\Blueprint; |
|||
use Illuminate\Support\Facades\Schema; |
|||
|
|||
class CreateFamilyMemberConnectionsTable extends Migration |
|||
{ |
|||
/** |
|||
* Run the migrations. |
|||
* |
|||
* @return void |
|||
*/ |
|||
public function up() |
|||
{ |
|||
Schema::create('family_member_connections', function (Blueprint $table) { |
|||
$table->uuid('id')->primary(); |
|||
$table->uuid('requester_id'); |
|||
$table->uuid('requested_id'); |
|||
$table->timestamps(); |
|||
|
|||
$table->unique(['requester_id', 'requested_id']); |
|||
}); |
|||
} |
|||
|
|||
/** |
|||
* Reverse the migrations. |
|||
* |
|||
* @return void |
|||
*/ |
|||
public function down() |
|||
{ |
|||
Schema::dropIfExists('family_member_connections'); |
|||
} |
|||
} |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue