// If an exception occurs when attempting to run a query, we'll format the error
// message to include the bindings with SQL, which will make this exception a
// lot more helpful to the developer instead of just the database's errors.
catch (Exception $e) {
throw new QueryException(
$query, $this->prepareBindings($bindings), $e
);
}
}
protected function tryAgainIfCausedByLostConnection(QueryException $e, $query, $bindings, Closure $callback)
{
if ($this->causedByLostConnection($e->getPrevious())) {
$this->reconnect();
return $this->runQueryCallback($query, $bindings, $callback);
}
throw $e;
}
if ($this->transactions >= 1) {
throw $e;
}
return $this->tryAgainIfCausedByLostConnection(
$e, $query, $bindings, $callback
);
}
/**
* Handle a query exception that occurred during query execution.
// to re-establish connection and re-run the query with a fresh connection.
try {
$result = $this->runQueryCallback($query, $bindings, $callback);
} catch (QueryException $e) {
$result = $this->handleQueryException(
$e, $query, $bindings, $callback
);
}
// Once we have run the query we will calculate the time that it took to run and
// then log the query, bindings, and execution time so we will report them on
$this->bindValues($statement, $this->prepareBindings($bindings));
$statement->execute();
return $statement->fetchAll();
});
}
/**
* Run a select statement against the database and returns a generator.
*
* @return array
*/
protected function runSelect()
{
return $this->connection->select(
$this->toSql(), $this->getBindings(), ! $this->useWritePdo
);
}
/**
* Paginate the given query into a simple paginator.
* @return \Illuminate\Support\Collection
*/
public function get($columns = ['*'])
{
return collect($this->onceWithColumns(Arr::wrap($columns), function () {
return $this->processor->processSelect($this, $this->runSelect());
}));
}
/**
* Run the query as a "select" statement against the connection.
if (is_null($original)) {
$this->columns = $columns;
}
$result = $callback();
$this->columns = $original;
return $result;
}
*/
public function get($columns = ['*'])
{
return collect($this->onceWithColumns(Arr::wrap($columns), function () {
return $this->processor->processSelect($this, $this->runSelect());
}));
}
/**
* Run the query as a "select" statement against the connection.
*
* @return \Illuminate\Database\Eloquent\Model[]|static[]
*/
public function getModels($columns = ['*'])
{
return $this->model->hydrate(
$this->query->get($columns)->all()
)->all();
}
/**
* Eager load the relationships for the models.
$builder = $this->applyScopes();
// If we actually found models we will also eager load any relationships that
// have been specified as needing to be eager loaded, which will solve the
// n+1 query issue for the developers to avoid running a lot of queries.
if (count($models = $builder->getModels($columns)) > 0) {
$models = $builder->eagerLoadRelations($models);
}
return $builder->getModel()->newCollection($models);
}
class LanguageRepository extends RepositoriesAbstract implements LanguageInterface
{
public function getActiveLanguage(array $select = ['*']): Collection
{
$data = $this->model->orderBy('lang_order')->select($select)->get();
$this->resetModel();
return $data;
}
* @return mixed
*/
public function getDataIfExistCache(string $function, array $args)
{
if (! setting('enable_cache', false) || (is_in_admin(true) && setting('disable_cache_in_the_admin_panel', false))) {
return call_user_func_array([$this->repository, $function], $args);
}
try {
$cacheKey = md5(
get_class($this) .
class LanguageCacheDecorator extends CacheAbstractDecorator implements LanguageInterface
{
public function getActiveLanguage(array $select = ['*']): Collection
{
return $this->getDataIfExistCache(__FUNCTION__, func_get_args());
}
public function getDefaultLanguage(array $select = ['*']): ?Model
{
return $this->getDataIfExistCache(__FUNCTION__, func_get_args());
{
if ($this->activeLanguages && $this->activeLanguageSelect === $select) {
return $this->activeLanguages;
}
$this->activeLanguages = $this->languageRepository->getActiveLanguage($select);
$this->activeLanguageSelect = $select;
return $this->activeLanguages;
}
{
if (! empty($this->supportedLocales)) {
return $this->supportedLocales;
}
$languages = $this->getActiveLanguage();
$locales = [];
foreach ($languages as $language) {
if (is_in_admin() || ! in_array($language->lang_id, json_decode(setting('language_hide_languages', '[]'), true))) {
$locales[$language->lang_locale] = [
if (! $locale) {
$locale = $this->getForcedLocale();
}
}
if (array_key_exists($locale, $this->getSupportedLocales())) {
$this->currentLocale = $locale;
} else {
// if the first segment/locale passed is not valid
// the system would ask which locale have to take
// it could be taken by the browser
$this->translatedRoutes = unserialize(base64_decode($serializedRoutes));
}
public function setRoutesCachePath(): string
{
$this->setLocale();
// compute $locale from url.
// It is null if url does not contain locale.
$locale = $this->getCurrentLocale();
if (! $instance) {
throw new RuntimeException('A facade root has not been set.');
}
return $instance->$method(...$args);
}
}
add_filter('cms_site_editor_locale', function () {
return Language::getCurrentAdminLocale();
}, 1134, 0);
Language::setRoutesCachePath();
}
}
public function addLanguageBox(string $priority, string|Model|null $object): void
{
if (static::isCallableWithAtSign($callback) || $defaultMethod) {
return static::callClass($container, $callback, $parameters, $defaultMethod);
}
return static::callBoundMethod($container, $callback, function () use ($container, $callback, $parameters) {
return $callback(...array_values(static::getMethodDependencies($container, $callback, $parameters)));
});
}
/**
* Call a string reference to a class using Class@method syntax.
* @param mixed ...$args
* @return mixed
*/
public static function unwrapIfClosure($value, ...$args)
{
return $value instanceof Closure ? $value(...$args) : $value;
}
/**
* Get the class name of the given parameter's type, if possible.
*
if ($container->hasMethodBinding($method)) {
return $container->callMethodBinding($method, $callback[0]);
}
return Util::unwrapIfClosure($default);
}
/**
* Normalize the given callback into a Class@method string.
*
return static::callClass($container, $callback, $parameters, $defaultMethod);
}
return static::callBoundMethod($container, $callback, function () use ($container, $callback, $parameters) {
return $callback(...array_values(static::getMethodDependencies($container, $callback, $parameters)));
});
}
/**
* Call a string reference to a class using Class@method syntax.
*
$this->buildStack[] = $className;
$pushedToBuildStack = true;
}
$result = BoundMethod::call($this, $callback, $parameters, $defaultMethod);
if ($pushedToBuildStack) {
array_pop($this->buildStack);
}
protected function bootProvider(ServiceProvider $provider)
{
$provider->callBootingCallbacks();
if (method_exists($provider, 'boot')) {
$this->call([$provider, 'boot']);
}
$provider->callBootedCallbacks();
}
// for any listeners that need to do work after this initial booting gets
// finished. This is useful when ordering the boot-up processes we run.
$this->fireAppCallbacks($this->bootingCallbacks);
array_walk($this->serviceProviders, function ($p) {
$this->bootProvider($p);
});
$this->booted = true;
$this->fireAppCallbacks($this->bootedCallbacks);
// finished. This is useful when ordering the boot-up processes we run.
$this->fireAppCallbacks($this->bootingCallbacks);
array_walk($this->serviceProviders, function ($p) {
$this->bootProvider($p);
});
$this->booted = true;
$this->fireAppCallbacks($this->bootedCallbacks);
}
* @param \Illuminate\Contracts\Foundation\Application $app
* @return void
*/
public function bootstrap(Application $app)
{
$app->boot();
}
}
$this->hasBeenBootstrapped = true;
foreach ($bootstrappers as $bootstrapper) {
$this['events']->dispatch('bootstrapping: '.$bootstrapper, [$this]);
$this->make($bootstrapper)->bootstrap($this);
$this['events']->dispatch('bootstrapped: '.$bootstrapper, [$this]);
}
}
* @return void
*/
public function bootstrap()
{
if (! $this->app->hasBeenBootstrapped()) {
$this->app->bootstrapWith($this->bootstrappers());
}
}
/**
* Get the route dispatcher callback.
{
$this->app->instance('request', $request);
Facade::clearResolvedInstance('request');
$this->bootstrap();
return (new Pipeline($this->app))
->send($request)
->through($this->app->shouldSkipMiddleware() ? [] : $this->middleware)
->then($this->dispatchToRouter());
$this->requestStartedAt = Carbon::now();
try {
$request->enableHttpMethodParameterOverride();
$response = $this->sendRequestThroughRouter($request);
} catch (Throwable $e) {
$this->reportException($e);
$response = $this->renderException($request, $e);
}
});
$kernel = $app->make(Kernel::class);
$response = $kernel->handle(
$request = Request::capture()
)->send();
$kernel->terminate($request, $response);
{
if (class_exists(PDOConnection::class) && ! $this->isPersistentConnection($options)) {
return new PDOConnection($dsn, $username, $password, $options);
}
return new PDO($dsn, $username, $password, $options);
}
/**
* Determine if the connection is persistent.
*
{
if (class_exists(PDOConnection::class) && ! $this->isPersistentConnection($options)) {
return new PDOConnection($dsn, $username, $password, $options);
}
return new PDO($dsn, $username, $password, $options);
}
/**
* Determine if the connection is persistent.
*
* @throws \Exception
*/
protected function tryAgainIfCausedByLostConnection(Throwable $e, $dsn, $username, $password, $options)
{
if ($this->causedByLostConnection($e)) {
return $this->createPdoConnection($dsn, $username, $password, $options);
}
throw $e;
}
return $this->createPdoConnection(
$dsn, $username, $password, $options
);
} catch (Exception $e) {
return $this->tryAgainIfCausedByLostConnection(
$e, $dsn, $username, $password, $options
);
}
}
/**
$options = $this->getOptions($config);
// We need to grab the PDO options that should be used while making the brand
// new connection instance. The PDO options control various aspects of the
// connection's behavior, and some might be specified by the developers.
$connection = $this->createConnection($dsn, $config, $options);
if (! empty($config['database'])) {
$connection->exec("use `{$config['database']}`;");
}
return function () use ($config) {
foreach (Arr::shuffle($this->parseHosts($config)) as $host) {
$config['host'] = $host;
try {
return $this->createConnector($config)->connect($config);
} catch (PDOException $e) {
continue;
}
}
* @return \PDO
*/
public function getPdo()
{
if ($this->pdo instanceof Closure) {
return $this->pdo = call_user_func($this->pdo);
}
return $this->pdo;
}
if ($this->readPdo instanceof Closure) {
return $this->readPdo = call_user_func($this->readPdo);
}
return $this->readPdo ?: $this->getPdo();
}
/**
* Get the current read PDO connection parameter without executing any reconnect logic.
*
* @param bool $useReadPdo
* @return \PDO
*/
protected function getPdoForSelect($useReadPdo = true)
{
return $useReadPdo ? $this->getReadPdo() : $this->getPdo();
}
/**
* Run an insert statement against the database.
*
// For select statements, we'll simply execute the query and return an array
// of the database result set. Each element in the array will be a single
// row from the database table, and will either be an array or objects.
$statement = $this->prepared(
$this->getPdoForSelect($useReadPdo)->prepare($query)
);
$this->bindValues($statement, $this->prepareBindings($bindings));
$statement->execute();
{
// To execute the statement, we'll simply call the callback, which will actually
// run the SQL against the PDO connection. Then we can calculate the time it
// took to execute and log the query SQL, bindings and time in our memory.
try {
return $callback($query, $bindings);
}
// If an exception occurs when attempting to run a query, we'll format the error
// message to include the bindings with SQL, which will make this exception a
// lot more helpful to the developer instead of just the database's errors.
protected function tryAgainIfCausedByLostConnection(QueryException $e, $query, $bindings, Closure $callback)
{
if ($this->causedByLostConnection($e->getPrevious())) {
$this->reconnect();
return $this->runQueryCallback($query, $bindings, $callback);
}
throw $e;
}
if ($this->transactions >= 1) {
throw $e;
}
return $this->tryAgainIfCausedByLostConnection(
$e, $query, $bindings, $callback
);
}
/**
* Handle a query exception that occurred during query execution.
// to re-establish connection and re-run the query with a fresh connection.
try {
$result = $this->runQueryCallback($query, $bindings, $callback);
} catch (QueryException $e) {
$result = $this->handleQueryException(
$e, $query, $bindings, $callback
);
}
// Once we have run the query we will calculate the time that it took to run and
// then log the query, bindings, and execution time so we will report them on
$this->bindValues($statement, $this->prepareBindings($bindings));
$statement->execute();
return $statement->fetchAll();
});
}
/**
* Run a select statement against the database and returns a generator.
*
* @return array
*/
protected function runSelect()
{
return $this->connection->select(
$this->toSql(), $this->getBindings(), ! $this->useWritePdo
);
}
/**
* Paginate the given query into a simple paginator.
* @return \Illuminate\Support\Collection
*/
public function get($columns = ['*'])
{
return collect($this->onceWithColumns(Arr::wrap($columns), function () {
return $this->processor->processSelect($this, $this->runSelect());
}));
}
/**
* Run the query as a "select" statement against the connection.
if (is_null($original)) {
$this->columns = $columns;
}
$result = $callback();
$this->columns = $original;
return $result;
}
*/
public function get($columns = ['*'])
{
return collect($this->onceWithColumns(Arr::wrap($columns), function () {
return $this->processor->processSelect($this, $this->runSelect());
}));
}
/**
* Run the query as a "select" statement against the connection.
*
* @return \Illuminate\Database\Eloquent\Model[]|static[]
*/
public function getModels($columns = ['*'])
{
return $this->model->hydrate(
$this->query->get($columns)->all()
)->all();
}
/**
* Eager load the relationships for the models.
$builder = $this->applyScopes();
// If we actually found models we will also eager load any relationships that
// have been specified as needing to be eager loaded, which will solve the
// n+1 query issue for the developers to avoid running a lot of queries.
if (count($models = $builder->getModels($columns)) > 0) {
$models = $builder->eagerLoadRelations($models);
}
return $builder->getModel()->newCollection($models);
}
class LanguageRepository extends RepositoriesAbstract implements LanguageInterface
{
public function getActiveLanguage(array $select = ['*']): Collection
{
$data = $this->model->orderBy('lang_order')->select($select)->get();
$this->resetModel();
return $data;
}
* @return mixed
*/
public function getDataIfExistCache(string $function, array $args)
{
if (! setting('enable_cache', false) || (is_in_admin(true) && setting('disable_cache_in_the_admin_panel', false))) {
return call_user_func_array([$this->repository, $function], $args);
}
try {
$cacheKey = md5(
get_class($this) .
class LanguageCacheDecorator extends CacheAbstractDecorator implements LanguageInterface
{
public function getActiveLanguage(array $select = ['*']): Collection
{
return $this->getDataIfExistCache(__FUNCTION__, func_get_args());
}
public function getDefaultLanguage(array $select = ['*']): ?Model
{
return $this->getDataIfExistCache(__FUNCTION__, func_get_args());
{
if ($this->activeLanguages && $this->activeLanguageSelect === $select) {
return $this->activeLanguages;
}
$this->activeLanguages = $this->languageRepository->getActiveLanguage($select);
$this->activeLanguageSelect = $select;
return $this->activeLanguages;
}
{
if (! empty($this->supportedLocales)) {
return $this->supportedLocales;
}
$languages = $this->getActiveLanguage();
$locales = [];
foreach ($languages as $language) {
if (is_in_admin() || ! in_array($language->lang_id, json_decode(setting('language_hide_languages', '[]'), true))) {
$locales[$language->lang_locale] = [
if (! $locale) {
$locale = $this->getForcedLocale();
}
}
if (array_key_exists($locale, $this->getSupportedLocales())) {
$this->currentLocale = $locale;
} else {
// if the first segment/locale passed is not valid
// the system would ask which locale have to take
// it could be taken by the browser
$this->translatedRoutes = unserialize(base64_decode($serializedRoutes));
}
public function setRoutesCachePath(): string
{
$this->setLocale();
// compute $locale from url.
// It is null if url does not contain locale.
$locale = $this->getCurrentLocale();
if (! $instance) {
throw new RuntimeException('A facade root has not been set.');
}
return $instance->$method(...$args);
}
}
add_filter('cms_site_editor_locale', function () {
return Language::getCurrentAdminLocale();
}, 1134, 0);
Language::setRoutesCachePath();
}
}
public function addLanguageBox(string $priority, string|Model|null $object): void
{
if (static::isCallableWithAtSign($callback) || $defaultMethod) {
return static::callClass($container, $callback, $parameters, $defaultMethod);
}
return static::callBoundMethod($container, $callback, function () use ($container, $callback, $parameters) {
return $callback(...array_values(static::getMethodDependencies($container, $callback, $parameters)));
});
}
/**
* Call a string reference to a class using Class@method syntax.
* @param mixed ...$args
* @return mixed
*/
public static function unwrapIfClosure($value, ...$args)
{
return $value instanceof Closure ? $value(...$args) : $value;
}
/**
* Get the class name of the given parameter's type, if possible.
*
if ($container->hasMethodBinding($method)) {
return $container->callMethodBinding($method, $callback[0]);
}
return Util::unwrapIfClosure($default);
}
/**
* Normalize the given callback into a Class@method string.
*
return static::callClass($container, $callback, $parameters, $defaultMethod);
}
return static::callBoundMethod($container, $callback, function () use ($container, $callback, $parameters) {
return $callback(...array_values(static::getMethodDependencies($container, $callback, $parameters)));
});
}
/**
* Call a string reference to a class using Class@method syntax.
*
$this->buildStack[] = $className;
$pushedToBuildStack = true;
}
$result = BoundMethod::call($this, $callback, $parameters, $defaultMethod);
if ($pushedToBuildStack) {
array_pop($this->buildStack);
}
protected function bootProvider(ServiceProvider $provider)
{
$provider->callBootingCallbacks();
if (method_exists($provider, 'boot')) {
$this->call([$provider, 'boot']);
}
$provider->callBootedCallbacks();
}
// for any listeners that need to do work after this initial booting gets
// finished. This is useful when ordering the boot-up processes we run.
$this->fireAppCallbacks($this->bootingCallbacks);
array_walk($this->serviceProviders, function ($p) {
$this->bootProvider($p);
});
$this->booted = true;
$this->fireAppCallbacks($this->bootedCallbacks);
// finished. This is useful when ordering the boot-up processes we run.
$this->fireAppCallbacks($this->bootingCallbacks);
array_walk($this->serviceProviders, function ($p) {
$this->bootProvider($p);
});
$this->booted = true;
$this->fireAppCallbacks($this->bootedCallbacks);
}
* @param \Illuminate\Contracts\Foundation\Application $app
* @return void
*/
public function bootstrap(Application $app)
{
$app->boot();
}
}
$this->hasBeenBootstrapped = true;
foreach ($bootstrappers as $bootstrapper) {
$this['events']->dispatch('bootstrapping: '.$bootstrapper, [$this]);
$this->make($bootstrapper)->bootstrap($this);
$this['events']->dispatch('bootstrapped: '.$bootstrapper, [$this]);
}
}
* @return void
*/
public function bootstrap()
{
if (! $this->app->hasBeenBootstrapped()) {
$this->app->bootstrapWith($this->bootstrappers());
}
}
/**
* Get the route dispatcher callback.
{
$this->app->instance('request', $request);
Facade::clearResolvedInstance('request');
$this->bootstrap();
return (new Pipeline($this->app))
->send($request)
->through($this->app->shouldSkipMiddleware() ? [] : $this->middleware)
->then($this->dispatchToRouter());
$this->requestStartedAt = Carbon::now();
try {
$request->enableHttpMethodParameterOverride();
$response = $this->sendRequestThroughRouter($request);
} catch (Throwable $e) {
$this->reportException($e);
$response = $this->renderException($request, $e);
}
});
$kernel = $app->make(Kernel::class);
$response = $kernel->handle(
$request = Request::capture()
)->send();
$kernel->terminate($request, $response);
[2/2]
QueryException
|
---|
Illuminate\Database\QueryException: SQLSTATE[HY000] [2002] Connection refused (SQL: select * from `languages` order by `lang_order` asc) at /home/copiac.co.ke/public_html/vendor/laravel/framework/src/Illuminate/Database/Connection.php:760 at Illuminate\Database\Connection->runQueryCallback() (/home/copiac.co.ke/public_html/vendor/laravel/framework/src/Illuminate/Database/Connection.php:899) at Illuminate\Database\Connection->tryAgainIfCausedByLostConnection() (/home/copiac.co.ke/public_html/vendor/laravel/framework/src/Illuminate/Database/Connection.php:879) at Illuminate\Database\Connection->handleQueryException() (/home/copiac.co.ke/public_html/vendor/laravel/framework/src/Illuminate/Database/Connection.php:723) at Illuminate\Database\Connection->run() (/home/copiac.co.ke/public_html/vendor/laravel/framework/src/Illuminate/Database/Connection.php:422) at Illuminate\Database\Connection->select() (/home/copiac.co.ke/public_html/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:2706) at Illuminate\Database\Query\Builder->runSelect() (/home/copiac.co.ke/public_html/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:2694) at Illuminate\Database\Query\Builder->Illuminate\Database\Query\{closure}() (/home/copiac.co.ke/public_html/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:3230) at Illuminate\Database\Query\Builder->onceWithColumns() (/home/copiac.co.ke/public_html/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:2695) at Illuminate\Database\Query\Builder->get() (/home/copiac.co.ke/public_html/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php:710) at Illuminate\Database\Eloquent\Builder->getModels() (/home/copiac.co.ke/public_html/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php:694) at Illuminate\Database\Eloquent\Builder->get() (/home/copiac.co.ke/public_html/platform/plugins/language/src/Repositories/Eloquent/LanguageRepository.php:14) at Botble\Language\Repositories\Eloquent\LanguageRepository->getActiveLanguage() at call_user_func_array() (/home/copiac.co.ke/public_html/vendor/botble/platform/support/src/Repositories/Caches/CacheAbstractDecorator.php:42) at Botble\Support\Repositories\Caches\CacheAbstractDecorator->getDataIfExistCache() (/home/copiac.co.ke/public_html/platform/plugins/language/src/Repositories/Caches/LanguageCacheDecorator.php:14) at Botble\Language\Repositories\Caches\LanguageCacheDecorator->getActiveLanguage() (/home/copiac.co.ke/public_html/platform/plugins/language/src/LanguageManager.php:127) at Botble\Language\LanguageManager->getActiveLanguage() (/home/copiac.co.ke/public_html/platform/plugins/language/src/LanguageManager.php:95) at Botble\Language\LanguageManager->getSupportedLocales() (/home/copiac.co.ke/public_html/platform/plugins/language/src/LanguageManager.php:952) at Botble\Language\LanguageManager->setLocale() (/home/copiac.co.ke/public_html/platform/plugins/language/src/LanguageManager.php:1048) at Botble\Language\LanguageManager->setRoutesCachePath() (/home/copiac.co.ke/public_html/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php:338) at Illuminate\Support\Facades\Facade::__callStatic() (/home/copiac.co.ke/public_html/platform/plugins/language/src/Providers/LanguageServiceProvider.php:179) at Botble\Language\Providers\LanguageServiceProvider->boot() (/home/copiac.co.ke/public_html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:36) at Illuminate\Container\BoundMethod::Illuminate\Container\{closure}() (/home/copiac.co.ke/public_html/vendor/laravel/framework/src/Illuminate/Container/Util.php:41) at Illuminate\Container\Util::unwrapIfClosure() (/home/copiac.co.ke/public_html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:93) at Illuminate\Container\BoundMethod::callBoundMethod() (/home/copiac.co.ke/public_html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:37) at Illuminate\Container\BoundMethod::call() (/home/copiac.co.ke/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php:661) at Illuminate\Container\Container->call() (/home/copiac.co.ke/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:929) at Illuminate\Foundation\Application->bootProvider() (/home/copiac.co.ke/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:910) at Illuminate\Foundation\Application->Illuminate\Foundation\{closure}() at array_walk() (/home/copiac.co.ke/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:911) at Illuminate\Foundation\Application->boot() (/home/copiac.co.ke/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/BootProviders.php:17) at Illuminate\Foundation\Bootstrap\BootProviders->bootstrap() (/home/copiac.co.ke/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:242) at Illuminate\Foundation\Application->bootstrapWith() (/home/copiac.co.ke/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:176) at Illuminate\Foundation\Http\Kernel->bootstrap() (/home/copiac.co.ke/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:160) at Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter() (/home/copiac.co.ke/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:134) at Illuminate\Foundation\Http\Kernel->handle() (/home/copiac.co.ke/public_html/public/index.php:56) |
[1/2]
PDOException
|
---|
PDOException: SQLSTATE[HY000] [2002] Connection refused at /home/copiac.co.ke/public_html/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:70 at PDO->__construct() (/home/copiac.co.ke/public_html/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:70) at Illuminate\Database\Connectors\Connector->createPdoConnection() (/home/copiac.co.ke/public_html/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:100) at Illuminate\Database\Connectors\Connector->tryAgainIfCausedByLostConnection() (/home/copiac.co.ke/public_html/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:50) at Illuminate\Database\Connectors\Connector->createConnection() (/home/copiac.co.ke/public_html/vendor/laravel/framework/src/Illuminate/Database/Connectors/MySqlConnector.php:24) at Illuminate\Database\Connectors\MySqlConnector->connect() (/home/copiac.co.ke/public_html/vendor/laravel/framework/src/Illuminate/Database/Connectors/ConnectionFactory.php:184) at Illuminate\Database\Connectors\ConnectionFactory->Illuminate\Database\Connectors\{closure}() at call_user_func() (/home/copiac.co.ke/public_html/vendor/laravel/framework/src/Illuminate/Database/Connection.php:1181) at Illuminate\Database\Connection->getPdo() (/home/copiac.co.ke/public_html/vendor/laravel/framework/src/Illuminate/Database/Connection.php:1217) at Illuminate\Database\Connection->getReadPdo() (/home/copiac.co.ke/public_html/vendor/laravel/framework/src/Illuminate/Database/Connection.php:486) at Illuminate\Database\Connection->getPdoForSelect() (/home/copiac.co.ke/public_html/vendor/laravel/framework/src/Illuminate/Database/Connection.php:414) at Illuminate\Database\Connection->Illuminate\Database\{closure}() (/home/copiac.co.ke/public_html/vendor/laravel/framework/src/Illuminate/Database/Connection.php:753) at Illuminate\Database\Connection->runQueryCallback() (/home/copiac.co.ke/public_html/vendor/laravel/framework/src/Illuminate/Database/Connection.php:899) at Illuminate\Database\Connection->tryAgainIfCausedByLostConnection() (/home/copiac.co.ke/public_html/vendor/laravel/framework/src/Illuminate/Database/Connection.php:879) at Illuminate\Database\Connection->handleQueryException() (/home/copiac.co.ke/public_html/vendor/laravel/framework/src/Illuminate/Database/Connection.php:723) at Illuminate\Database\Connection->run() (/home/copiac.co.ke/public_html/vendor/laravel/framework/src/Illuminate/Database/Connection.php:422) at Illuminate\Database\Connection->select() (/home/copiac.co.ke/public_html/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:2706) at Illuminate\Database\Query\Builder->runSelect() (/home/copiac.co.ke/public_html/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:2694) at Illuminate\Database\Query\Builder->Illuminate\Database\Query\{closure}() (/home/copiac.co.ke/public_html/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:3230) at Illuminate\Database\Query\Builder->onceWithColumns() (/home/copiac.co.ke/public_html/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:2695) at Illuminate\Database\Query\Builder->get() (/home/copiac.co.ke/public_html/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php:710) at Illuminate\Database\Eloquent\Builder->getModels() (/home/copiac.co.ke/public_html/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php:694) at Illuminate\Database\Eloquent\Builder->get() (/home/copiac.co.ke/public_html/platform/plugins/language/src/Repositories/Eloquent/LanguageRepository.php:14) at Botble\Language\Repositories\Eloquent\LanguageRepository->getActiveLanguage() at call_user_func_array() (/home/copiac.co.ke/public_html/vendor/botble/platform/support/src/Repositories/Caches/CacheAbstractDecorator.php:42) at Botble\Support\Repositories\Caches\CacheAbstractDecorator->getDataIfExistCache() (/home/copiac.co.ke/public_html/platform/plugins/language/src/Repositories/Caches/LanguageCacheDecorator.php:14) at Botble\Language\Repositories\Caches\LanguageCacheDecorator->getActiveLanguage() (/home/copiac.co.ke/public_html/platform/plugins/language/src/LanguageManager.php:127) at Botble\Language\LanguageManager->getActiveLanguage() (/home/copiac.co.ke/public_html/platform/plugins/language/src/LanguageManager.php:95) at Botble\Language\LanguageManager->getSupportedLocales() (/home/copiac.co.ke/public_html/platform/plugins/language/src/LanguageManager.php:952) at Botble\Language\LanguageManager->setLocale() (/home/copiac.co.ke/public_html/platform/plugins/language/src/LanguageManager.php:1048) at Botble\Language\LanguageManager->setRoutesCachePath() (/home/copiac.co.ke/public_html/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php:338) at Illuminate\Support\Facades\Facade::__callStatic() (/home/copiac.co.ke/public_html/platform/plugins/language/src/Providers/LanguageServiceProvider.php:179) at Botble\Language\Providers\LanguageServiceProvider->boot() (/home/copiac.co.ke/public_html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:36) at Illuminate\Container\BoundMethod::Illuminate\Container\{closure}() (/home/copiac.co.ke/public_html/vendor/laravel/framework/src/Illuminate/Container/Util.php:41) at Illuminate\Container\Util::unwrapIfClosure() (/home/copiac.co.ke/public_html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:93) at Illuminate\Container\BoundMethod::callBoundMethod() (/home/copiac.co.ke/public_html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:37) at Illuminate\Container\BoundMethod::call() (/home/copiac.co.ke/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php:661) at Illuminate\Container\Container->call() (/home/copiac.co.ke/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:929) at Illuminate\Foundation\Application->bootProvider() (/home/copiac.co.ke/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:910) at Illuminate\Foundation\Application->Illuminate\Foundation\{closure}() at array_walk() (/home/copiac.co.ke/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:911) at Illuminate\Foundation\Application->boot() (/home/copiac.co.ke/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/BootProviders.php:17) at Illuminate\Foundation\Bootstrap\BootProviders->bootstrap() (/home/copiac.co.ke/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:242) at Illuminate\Foundation\Application->bootstrapWith() (/home/copiac.co.ke/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:176) at Illuminate\Foundation\Http\Kernel->bootstrap() (/home/copiac.co.ke/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:160) at Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter() (/home/copiac.co.ke/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:134) at Illuminate\Foundation\Http\Kernel->handle() (/home/copiac.co.ke/public_html/public/index.php:56) |