Remove guarded from member model

This commit is contained in:
philipp lang 2022-05-31 21:50:35 +02:00
parent 58256819db
commit 364952eae9
2 changed files with 11 additions and 3 deletions

View File

@ -35,7 +35,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', 'subscription_id', 'region_id', 'gender_id', 'confession_id', 'letter_address', 'bill_kind_id', 'version', 'first_subactivity_id', 'first_activity_id', 'confirmed_at', 'children_phone', 'efz', 'ps_at', 'more_ps_at', 'has_svk', 'has_vk', 'without_education_at', 'without_efz_at', 'multiply_pv', 'multiply_more_pv'];
public $guarded = [];
public $dates = ['try_created_at', 'joined_at', 'birthday'];

View File

@ -56,7 +56,15 @@ class MemberRequest extends FormRequest
'bill_kind_id' => 'nullable|exists:bill_kinds,id',
'joined_at' => 'date|required',
'confession_id' => 'nullable|exists:confessions,id',
'efz' => 'nullable|date',
'ps_at' => 'nullable|date_format:Y-m-d',
'more_ps_at' => 'nullable|date_format:Y-m-d',
'has_svk' => 'boolean',
'has_vk' => 'boolean',
'efz' => 'nullable|date_format:Y-m-d',
'without_education_at' => 'nullable|date_format:Y-m-d',
'without_efz_at' => 'nullable|date_format:Y-m-d',
'multiply_pv' => 'boolean',
'multiply_more_pv' => 'boolean',
];
}
@ -71,7 +79,7 @@ class MemberRequest extends FormRequest
public function persistUpdate(Member $member): void
{
$member->update($this->input());
$member->update($this->validated());
if ($this->input('has_nami') && null === $member->nami_id) {
CreateJob::dispatch($member);