8 changed files with 217 additions and 5 deletions
-
10app/Couple.php
-
35app/Http/Controllers/FamilyActionsController.php
-
34app/User.php
-
4database/factories/ModelFactory.php
-
35database/migrations/2017_06_27_151536_create_couples_table.php
-
47resources/views/home.blade.php
-
2routes/web.php
-
55tests/Feature/ManageUserFamiliesTest.php
@ -0,0 +1,10 @@ |
|||
<?php |
|||
|
|||
namespace App; |
|||
|
|||
use Illuminate\Database\Eloquent\Model; |
|||
|
|||
class Couple extends Model |
|||
{ |
|||
//
|
|||
} |
|||
@ -0,0 +1,35 @@ |
|||
<?php |
|||
|
|||
use Illuminate\Support\Facades\Schema; |
|||
use Illuminate\Database\Schema\Blueprint; |
|||
use Illuminate\Database\Migrations\Migration; |
|||
|
|||
class CreateCouplesTable extends Migration |
|||
{ |
|||
/** |
|||
* Run the migrations. |
|||
* |
|||
* @return void |
|||
*/ |
|||
public function up() |
|||
{ |
|||
Schema::create('couples', function (Blueprint $table) { |
|||
$table->increments('id'); |
|||
$table->unsignedInteger('husband_id')->index(); |
|||
$table->unsignedInteger('wife_id')->index(); |
|||
$table->date('marriege_date')->nullable(); |
|||
$table->date('divorce_date')->nullable(); |
|||
$table->timestamps(); |
|||
}); |
|||
} |
|||
|
|||
/** |
|||
* Reverse the migrations. |
|||
* |
|||
* @return void |
|||
*/ |
|||
public function down() |
|||
{ |
|||
Schema::dropIfExists('couples'); |
|||
} |
|||
} |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue