Force default timezone to UTC; move helpers.php
This commit is contained in:
@@ -224,14 +224,14 @@ trait CacheableRepository
|
|||||||
public function paginate($limit = null, $columns = ['*'], $method='paginate')
|
public function paginate($limit = null, $columns = ['*'], $method='paginate')
|
||||||
{
|
{
|
||||||
if (!$this->allowedCache('paginate') || $this->isSkippedCache()) {
|
if (!$this->allowedCache('paginate') || $this->isSkippedCache()) {
|
||||||
return parent::paginate($limit, $columns);
|
return parent::paginate($limit, $columns, $method);
|
||||||
}
|
}
|
||||||
|
|
||||||
$key = $this->getCacheKey('paginate', func_get_args());
|
$key = $this->getCacheKey('paginate', func_get_args());
|
||||||
|
|
||||||
$minutes = $this->getCacheMinutes();
|
$minutes = $this->getCacheMinutes();
|
||||||
$value = $this->getCacheRepository()->remember($key, $minutes, function () use ($limit, $columns) {
|
$value = $this->getCacheRepository()->remember($key, $minutes, function () use ($limit, $columns, $method) {
|
||||||
return parent::paginate($limit, $columns);
|
return parent::paginate($limit, $columns, $method);
|
||||||
});
|
});
|
||||||
|
|
||||||
$this->resetModel();
|
$this->resetModel();
|
||||||
|
|||||||
@@ -64,7 +64,7 @@
|
|||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"files": [
|
"files": [
|
||||||
"app/Support/helpers.php"
|
"app/helpers.php"
|
||||||
],
|
],
|
||||||
"classmap": [
|
"classmap": [
|
||||||
"database"
|
"database"
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ return [
|
|||||||
'url' => env('APP_URL', 'http://localhost'),
|
'url' => env('APP_URL', 'http://localhost'),
|
||||||
'version' => '4.0',
|
'version' => '4.0',
|
||||||
|
|
||||||
'timezone' => env('APP_TIMEZONE', 'UTC'),
|
'timezone' => 'UTC',
|
||||||
'locale' => env('APP_LOCALE', 'en'),
|
'locale' => env('APP_LOCALE', 'en'),
|
||||||
'fallback_locale' => 'en',
|
'fallback_locale' => 'en',
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ return [
|
|||||||
'username' => env('DB_USERNAME', 'forge'),
|
'username' => env('DB_USERNAME', 'forge'),
|
||||||
'password' => env('DB_PASSWORD', ''),
|
'password' => env('DB_PASSWORD', ''),
|
||||||
'unix_socket' => env('DB_SOCKET', ''),
|
'unix_socket' => env('DB_SOCKET', ''),
|
||||||
|
'timezone' => '+00:00',
|
||||||
'charset' => 'utf8',
|
'charset' => 'utf8',
|
||||||
'collation' => 'utf8_unicode_ci',
|
'collation' => 'utf8_unicode_ci',
|
||||||
'prefix' => '',
|
'prefix' => '',
|
||||||
@@ -22,21 +23,25 @@ return [
|
|||||||
'sqlite' => [
|
'sqlite' => [
|
||||||
'driver' => 'sqlite',
|
'driver' => 'sqlite',
|
||||||
'database' => env('DB_DATABASE', storage_path('db.sqlite')),
|
'database' => env('DB_DATABASE', storage_path('db.sqlite')),
|
||||||
|
'timezone' => '+00:00',
|
||||||
'prefix' => '',
|
'prefix' => '',
|
||||||
],
|
],
|
||||||
'local' => [
|
'local' => [
|
||||||
'driver' => 'sqlite',
|
'driver' => 'sqlite',
|
||||||
'database' => storage_path('local.sqlite'),
|
'database' => storage_path('local.sqlite'),
|
||||||
|
'timezone' => '+00:00',
|
||||||
'prefix' => '',
|
'prefix' => '',
|
||||||
],
|
],
|
||||||
'unittest' => [
|
'unittest' => [
|
||||||
'driver' => 'sqlite',
|
'driver' => 'sqlite',
|
||||||
'database' => storage_path('unittest.sqlite'),
|
'database' => storage_path('unittest.sqlite'),
|
||||||
|
'timezone' => '+00:00',
|
||||||
'prefix' => '',
|
'prefix' => '',
|
||||||
],
|
],
|
||||||
'memory' => [
|
'memory' => [
|
||||||
'driver' => 'sqlite',
|
'driver' => 'sqlite',
|
||||||
'database' => ':memory:',
|
'database' => ':memory:',
|
||||||
|
'timezone' => '+00:00',
|
||||||
'prefix' => '',
|
'prefix' => '',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
|||||||
Reference in New Issue
Block a user