Fixed country show fields..
This commit is contained in:
parent
40b294480a
commit
b7fda70b98
@ -27,7 +27,7 @@ class Company extends Eloquent implements Ownable
|
|||||||
|
|
||||||
protected $table = 'companies';
|
protected $table = 'companies';
|
||||||
|
|
||||||
protected $with = ['settings'];
|
//protected $with = ['settings'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The accessors to append to the model's array form.
|
* The accessors to append to the model's array form.
|
||||||
@ -529,7 +529,7 @@ class Company extends Eloquent implements Ownable
|
|||||||
|
|
||||||
$country = setting('company.country');
|
$country = setting('company.country');
|
||||||
|
|
||||||
if ($country && in_array($country, trans('countries'))) {
|
if ($country && array_key_exists($country, trans('countries'))) {
|
||||||
$location[] = trans('countries.' . $country);
|
$location[] = trans('countries.' . $country);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -278,7 +278,7 @@ class Contact extends Model
|
|||||||
$location[] = $this->state;
|
$location[] = $this->state;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->country && in_array($this->country, trans('countries'))) {
|
if ($this->country && array_key_exists($this->country, trans('countries'))) {
|
||||||
$location[] = trans('countries.' . $this->country);
|
$location[] = trans('countries.' . $this->country);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -471,7 +471,7 @@ class Document extends Model
|
|||||||
$location[] = $this->contact_state;
|
$location[] = $this->contact_state;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->contact_country && in_array($this->contact_country, trans('countries'))) {
|
if ($this->contact_country && array_key_exists($this->contact_country, trans('countries'))) {
|
||||||
$location[] = trans('countries.' . $this->contact_country);
|
$location[] = trans('countries.' . $this->contact_country);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ class Country extends Component
|
|||||||
*/
|
*/
|
||||||
public function render()
|
public function render()
|
||||||
{
|
{
|
||||||
if (! empty($this->code) && in_array($this->code, trans('countries'))) {
|
if (! empty($this->code) && array_key_exists($this->code, trans('countries'))) {
|
||||||
$this->country = trans('countries.' . $this->code);
|
$this->country = trans('countries.' . $this->code);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user