getRouteKey(); } public function title() { if ($this->title != '') { return $this->title; } if ($this->name != '') { return $this->name; } return 'None'; } public function toArray() { return [ 'id' => $this->getRouteKey(), 'title' => $this->title(), 'user_id' => $this->user_id, 'first_name' => $this->first_name, 'last_name' => $this->last_name, 'legal_name' => $this->legal_name, 'business_email' => $this->business_email, 'job_title' => $this->job_title, 'phone' => $this->phone, 'billing_first_name' => $this->billing_first_name, 'billing_last_name' => $this->billing_last_name, 'billing_legal_name' => $this->billing_legal_name, 'billing_business_email' => $this->billing_business_email, 'billing_job_title' => $this->billing_job_title, 'billing_phone' => $this->billing_phone, 'business_type' => $this->business_type, 'business_name' => $this->business_name, 'trading_name' => $this->trading_name, 'office_address' => $this->office_address, 'country' => $this->country, 'city' => $this->city, 'state' => $this->state, 'post_code' => $this->post_code, 'same_address' => $this->same_address, 'business_wesite' => $this->business_wesite, 'industry' => $this->industry, 'business_established' => $this->business_established, 'employee_count' => $this->employee_count, 'anual_revenue' => $this->anual_revenue, 'currency' => $this->currency, 'abn' => $this->abn, 'credit_line' => $this->credit_line, 'monthly_spend' => $this->monthly_spend, 'goods_description' => $this->goods_description, 'account_holder' => $this->account_holder, 'bank_name' => $this->bank_name, 'bank_account_type' => $this->bank_account_type, 'bsb_number' => $this->bsb_number, 'account_number' => $this->account_number, 'bsb_street_address' => $this->bsb_street_address, 'bsb_country' => $this->bsb_country, 'bsb_city' => $this->bsb_city, 'bsb_state' => $this->bsb_state, 'bsb_post_code' => $this->bsb_post_code, 'bank_statement' => $this->bank_statement, 'account_holder_agreement' => $this->account_holder_agreement, 'confirming_identity' => $this->confirming_identity, 'authorized_legal_name' => $this->authorized_legal_name, 'authorized_job_title' => $this->authorized_job_title, 'authorized_dob' => $this->authorized_dob, 'authorized_country' => $this->authorized_country, 'authorized_street_address' => $this->authorized_street_address, 'authorized_city' => $this->authorized_city, 'authorized_state' => $this->authorized_state, 'authorized_post_code' => $this->authorized_post_code, 'identity_type' => $this->identity_type, 'identity_number' => $this->identity_number, 'expiry_date' => $this->expiry_date, 'upload_identity' => $this->upload_identity, 'created_at' => !is_null($this->created_at) ? $this->created_at->format('Y-m-d H:i:s') : null, 'updated_at' => !is_null($this->updated_at) ? $this->updated_at->format('Y-m-d H:i:s') : null, 'meta' => [ 'exists' => $this->exists(), 'link' => $this->itemLink(), 'upload_url' => $this->getUploadURL(''), ], ]; } }