This commit is contained in:
Kevin Adametz 2020-01-02 19:22:30 +01:00
parent f03862b523
commit 1a43060996
42 changed files with 1160 additions and 83 deletions

View file

@ -105,11 +105,9 @@ use Carbon\Carbon;
class UserAccount extends Model
{
protected $table = 'user_accounts';
protected $fillable = [
'company', 'salutation', 'first_name', 'last_name', 'address', 'address_2', 'zipcode', 'city', 'country_id', 'pre_phone_id', 'phone', 'pre_mobil_id', 'mobil',
'tax_number', 'tax_identification_number', 'same_as_billing',
'm_account', 'm_salutation', 'm_first_name', 'm_last_name', 'm_notes', 'company', 'salutation', 'first_name', 'last_name', 'address', 'address_2', 'zipcode', 'city', 'country_id', 'pre_phone_id', 'phone', 'pre_mobil_id', 'mobil',
'tax_number', 'tax_identification_number', 'taxable_sales', 'same_as_billing',
'shipping_salutation', 'shipping_company', 'shipping_firstname', 'shipping_lastname', 'shipping_address', 'shipping_address_2', 'shipping_zipcode', 'shipping_city', 'shipping_country_id', 'shipping_pre_phone_id', 'shipping_phone',
'birthday', 'website', 'facebook', 'facebook_fanpage', 'instagram'
];
@ -166,6 +164,22 @@ class UserAccount extends Model
}
public function getCountryAttrAs($attr, $as = false){
if($this->country){
$val = $this->country->getAttrByKey($attr);
if($val){
if($as){
return $as;
}
return true;
}
}
return "";
}
}