Update relations
This commit is contained in:
parent
9568c630f0
commit
df9b6ca6ed
app
database/migrations
|
@ -30,7 +30,7 @@ class InitializeMembers {
|
|||
'nickname' => $member->nickname,
|
||||
'joined_at' => $member->joined_at,
|
||||
'birthday' => $member->birthday,
|
||||
'sendnewspaper' => true, // @todo implement in nami api
|
||||
'send_newspaper' => $member->send_newspaper,
|
||||
'address' => $member->address,
|
||||
'zip' => $member->zip,
|
||||
'location' => $member->location,
|
||||
|
@ -46,9 +46,9 @@ class InitializeMembers {
|
|||
'nami_id' => $member->id,
|
||||
'gender_id' => Gender::firstOrFail('nami_id', $member->gender_id)->id,
|
||||
'confession_id' => optional(Confession::firstWhere('nami_id', $member->confession_id))->id,
|
||||
'region_id' => 1, // @todo implement in nami api
|
||||
'country_id' => 1, // @todo implement in nami api
|
||||
'nationality_id' => 1, // @todo implement in nami api
|
||||
'region_id' => Region::firstOrFail('nami_id', $member->region_id)->id,
|
||||
'country_id' => Country::firstOrFail('nami_id', $member->country_id)->id,
|
||||
'nationality_id' => Nationality::firstOrFail('nami_id', $member->nationality_id)->id,
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -10,12 +10,12 @@ class Member extends Model
|
|||
{
|
||||
use Notifiable;
|
||||
|
||||
public $fillable = ['firstname', 'lastname', 'nickname', 'other_country', 'birthday', 'joined_at', 'sendnewspaper', 'address', 'further_address', 'zip', 'location', 'main_phone', 'mobile_phone', 'work_phone', 'fax', 'email', 'email_parents', 'nami_id', 'letter_address', 'country_id', 'way_id', 'nationality_id', 'subscription_id', 'region_id', 'gender_id', 'confession_id'];
|
||||
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', 'letter_address', 'country_id', 'way_id', 'nationality_id', 'subscription_id', 'region_id', 'gender_id', 'confession_id'];
|
||||
|
||||
public $dates = ['joined_at', 'birthday'];
|
||||
|
||||
public $casts = [
|
||||
'sendnewspaper' => 'boolean',
|
||||
'send_newspaper' => 'boolean',
|
||||
'gender_id' => 'integer',
|
||||
'way_id' => 'integer',
|
||||
'country_id' => 'integer',
|
||||
|
|
|
@ -24,7 +24,7 @@ class CreateMembersTable extends Migration
|
|||
$table->integer('confession_id')->unsigned()->nullable();
|
||||
$table->date('birthday');
|
||||
$table->date('joined_at');
|
||||
$table->boolean('sendnewspaper');
|
||||
$table->boolean('send_newspaper');
|
||||
$table->string('address');
|
||||
$table->string('further_address')->nullable();
|
||||
$table->string('zip');
|
||||
|
|
Loading…
Reference in New Issue