Skip to content
This repository has been archived by the owner on Jul 20, 2022. It is now read-only.

Commit

Permalink
Laravel 6.x support
Browse files Browse the repository at this point in the history
  • Loading branch information
coppolafab committed Mar 30, 2021
1 parent 070c8df commit c206f7d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"license": "ISC",
"authors": [
{
"name": "Fabio Coppola",
"homepage": "https://github.com/coppolafab"
}
],
Expand All @@ -23,8 +24,8 @@
"require": {
"php": ">=7.2",
"ext-pdo": "*",
"illuminate/support": "^5.7|^7.0",
"illuminate/database": "^5.7|^7.0"
"illuminate/support": "^5.7|^6.0|^7.0",
"illuminate/database": "^5.7|^6.0|^7.0"
},
"extra": {
"laravel": {
Expand Down
1 change: 1 addition & 0 deletions src/MicroMySqlConnection.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

declare(strict_types=1);

namespace coppolafab\MicroMySqlDriver;
Expand Down
1 change: 1 addition & 0 deletions src/MicroMySqlConnector.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

declare(strict_types=1);

namespace coppolafab\MicroMySqlDriver;
Expand Down
5 changes: 3 additions & 2 deletions src/MicroMySqlDriverServiceProvider.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

declare(strict_types=1);

namespace coppolafab\MicroMySqlDriver;
Expand All @@ -10,13 +11,13 @@ class MicroMySqlDriverServiceProvider extends ServiceProvider
{
public function boot()
{
if (config('database.connections.mysql.microOverrideDriver')) {
if ($this->app['config']->get('database.connections.mysql.microOverrideDriver')) {
$this->app->bind('db.connector.mysql', function () {
return new MicroMySqlConnector();
});
}

if (config('database.connections.mysql.sticky') && config('database.connections.mysql.microCloseReadConnectionAfterWrite')) {
if ($this->app['config']->get('database.connections.mysql.sticky') && $this->app['config']->get('database.connections.mysql.microCloseReadConnectionAfterWrite')) {
Connection::resolverFor('mysql', function ($connection, $database, $prefix, $config) {
return new MicroMySqlConnection($connection, $database, $prefix, $config);
});
Expand Down

0 comments on commit c206f7d

Please sign in to comment.