'int', 'credit_card_type_id' => 'int', 'country_id' => 'int' ]; protected $dates = [ 'birthdate', 'credit_card_expiration_date' ]; protected $fillable = [ 'salutation_id', 'title', 'name', 'firstname', 'birthdate', 'company', 'street', 'zip', 'city', 'email', 'phone', 'phonebusiness', 'phonemobile', 'fax', 'bank', 'bank_code', 'bank_account_number', 'credit_card_type_id', 'credit_card_number', 'credit_card_expiration_date', 'participants_remarks', 'miscellaneous_remarks', 'country_id', ]; public static $salutationType = [ 1 => 'Mann', 2 => 'Frau' ]; public function travel_country() { return $this->belongsTo(TravelCountry::class, 'country_id'); } public function credit_card_type() { return $this->belongsTo(CreditCardType::class); } public function salutation() { return $this->belongsTo(Salutation::class); } public function bookings() { return $this->hasMany(Booking::class); } public function coupons() { return $this->hasMany(Coupon::class); } public function leads() { return $this->hasMany(Lead::class); } public function fullName() { if ($this->firstname) { return $this->firstname . ' ' . $this->name; } return $this->name; } public static function getCustomerCountriesArray(){ return TravelCountry::where('is_customer_country', 1)->get()->pluck('name', 'id'); } }