MOON
Server: Apache
System: Linux host.sunshiene.com 4.18.0-553.121.1.el8_10.x86_64 #1 SMP Thu Apr 30 09:06:34 EDT 2026 x86_64
User: clientsoftwares (1005)
PHP: 8.1.34
Disabled: system, exec, mail, shell_exec, passthru, popen, proc_open, pcntl_exec, dl, ini_alter, ini_restore, symlink, link, chown, posix_kill
Upload Files
File: /home/clientsoftwares/www/lms.clientsoftwares.com/app/BillingDetails.php
<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class BillingDetails extends Model
{
    protected $connection;

    protected $guarded = [];

    protected $casts = [
        'city' => 'integer',
    ];

    public function __construct(array $attributes = array())
    {
        parent::__construct($attributes);
        if (isModuleActive('LmsSaasMD') && SaasDomain() != "main") {
            $this->setConnection('mysql_md');
        } else {
            $this->setConnection(config('database.default'));
        }
    }


    public function getNameAttribute()
    {
        return "{$this->first_name} {$this->last_name}";
    }
    public function country()
    {
        return $this->belongsTo(Country::class, 'country')->withDefault();
    }

    public function countryDetails()
    {
        return $this->belongsTo(Country::class, 'country')->withDefault();
    }

    public function stateDetails()
    {
        return $this->belongsTo(State::class, 'state')->withDefault();
    }

    public function cityDetails()
    {
        return $this->belongsTo(City::class, 'city')->withDefault();
    }
}