From c7de560d446946edde06a916490c9b5ccb153231 Mon Sep 17 00:00:00 2001 From: philipp lang Date: Mon, 28 Jun 2021 22:55:55 +0200 Subject: [PATCH] Add children phone --- app/Member/Member.php | 2 +- app/Member/MemberResource.php | 1 + ...5_create_members_children_phone_column.php | 32 +++++++++++++++++++ resources/js/views/member/Form.vue | 7 ++-- 4 files changed, 38 insertions(+), 4 deletions(-) create mode 100644 database/migrations/2021_06_28_205305_create_members_children_phone_column.php diff --git a/app/Member/Member.php b/app/Member/Member.php index e6b948f7..6de52a84 100644 --- a/app/Member/Member.php +++ b/app/Member/Member.php @@ -19,7 +19,7 @@ class Member extends Model use Notifiable; use HasFactory; - public $fillable = ['firstname', 'lastname', 'nickname', 'other_country', 'birthday', 'joined_at', 'send_newspaper', 'address', 'further_address', 'zip', 'location', 'main_phone', 'mobile_phone', 'work_phone', 'fax', 'email', 'email_parents', 'nami_id', 'group_id', 'letter_address', 'country_id', 'way_id', 'nationality_id', 'fee_id', 'region_id', 'gender_id', 'confession_id', 'letter_address', 'bill_kind_id', 'version', 'first_subactivity_id', 'first_activity_id', 'confirmed_at']; + public $fillable = ['firstname', 'lastname', 'nickname', 'other_country', 'birthday', 'joined_at', 'send_newspaper', 'address', 'further_address', 'zip', 'location', 'main_phone', 'mobile_phone', 'work_phone', 'fax', 'email', 'email_parents', 'nami_id', 'group_id', 'letter_address', 'country_id', 'way_id', 'nationality_id', 'fee_id', 'region_id', 'gender_id', 'confession_id', 'letter_address', 'bill_kind_id', 'version', 'first_subactivity_id', 'first_activity_id', 'confirmed_at', 'children_phone']; public $dates = ['joined_at', 'birthday']; diff --git a/app/Member/MemberResource.php b/app/Member/MemberResource.php index 813fa392..42863557 100644 --- a/app/Member/MemberResource.php +++ b/app/Member/MemberResource.php @@ -45,6 +45,7 @@ class MemberResource extends JsonResource 'bill_kind_name' => optional($this->billKind)->name, 'has_nami' => $this->nami_id !== null, 'is_confirmed' => $this->is_confirmed, + 'children_phone' => $this->children_phone, ]; } } diff --git a/database/migrations/2021_06_28_205305_create_members_children_phone_column.php b/database/migrations/2021_06_28_205305_create_members_children_phone_column.php new file mode 100644 index 00000000..8c3d6332 --- /dev/null +++ b/database/migrations/2021_06_28_205305_create_members_children_phone_column.php @@ -0,0 +1,32 @@ +string('children_phone')->nullable(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('members', function (Blueprint $table) { + $table->dropColumn('children_phone'); + }); + } +} diff --git a/resources/js/views/member/Form.vue b/resources/js/views/member/Form.vue index f5a3e6b4..b6467dab 100644 --- a/resources/js/views/member/Form.vue +++ b/resources/js/views/member/Form.vue @@ -33,9 +33,10 @@
- - - + + + +