mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
move statics into container
This commit is contained in:
parent
836802764a
commit
fe6d837123
@ -636,17 +636,19 @@ class Company extends BaseModel
|
|||||||
|
|
||||||
public function country()
|
public function country()
|
||||||
{
|
{
|
||||||
$companies = Cache::get('countries');
|
$countries = app('countries');
|
||||||
|
|
||||||
if (! $companies) {
|
// $countries = Cache::get('countries');
|
||||||
$this->buildCache(true);
|
|
||||||
|
|
||||||
$companies = Cache::get('countries');
|
// if (! $companies) {
|
||||||
}
|
// $this->buildCache(true);
|
||||||
|
|
||||||
return $companies->filter(function ($item) {
|
// $companies = Cache::get('countries');
|
||||||
|
// }
|
||||||
|
|
||||||
|
return $countries->first(function ($item) {
|
||||||
return $item->id == $this->getSetting('country_id');
|
return $item->id == $this->getSetting('country_id');
|
||||||
})->first();
|
});
|
||||||
|
|
||||||
// return $this->belongsTo(Country::class);
|
// return $this->belongsTo(Country::class);
|
||||||
// return Country::find($this->settings->country_id);
|
// return Country::find($this->settings->country_id);
|
||||||
@ -659,15 +661,17 @@ class Company extends BaseModel
|
|||||||
|
|
||||||
public function timezone()
|
public function timezone()
|
||||||
{
|
{
|
||||||
$timezones = Cache::get('timezones');
|
// $timezones = Cache::get('timezones');
|
||||||
|
|
||||||
if (! $timezones) {
|
$timezones = app('timezones');
|
||||||
$this->buildCache(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $timezones->filter(function ($item) {
|
// if (! $timezones) {
|
||||||
|
// $this->buildCache(true);
|
||||||
|
// }
|
||||||
|
|
||||||
|
return $timezones->first(function ($item) {
|
||||||
return $item->id == $this->settings->timezone_id;
|
return $item->id == $this->settings->timezone_id;
|
||||||
})->first();
|
});
|
||||||
|
|
||||||
// return Timezone::find($this->settings->timezone_id);
|
// return Timezone::find($this->settings->timezone_id);
|
||||||
}
|
}
|
||||||
|
@ -201,7 +201,7 @@ return [
|
|||||||
App\Providers\MultiDBProvider::class,
|
App\Providers\MultiDBProvider::class,
|
||||||
App\Providers\ClientPortalServiceProvider::class,
|
App\Providers\ClientPortalServiceProvider::class,
|
||||||
App\Providers\NinjaTranslationServiceProvider::class,
|
App\Providers\NinjaTranslationServiceProvider::class,
|
||||||
App\Providers\StaticServiceProvider::class,
|
App\Providers\StaticServiceProvider::class,
|
||||||
],
|
],
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user