Skip to content
Discussion options

You must be logged in to vote

Got it working by creating something more advanced

class EncryptedMigration extends \Illuminate\Database\Migrations\Migration
{
    public function __construct()
    {
        Connection::resolverFor('pgsql', function ($connection, $database, $prefix, $config) {
            return new PostgresConnection($connection, $database, $prefix, $config);
        });
        app('db')->purge();
    }

    /**
     * Get the migration connection name.
     *
     * @return string|null
     */
    public function getConnection()
    {
        return $this->connection;
    }
}

The key is to call

app('db')->purge();

after setting the resolver for connection

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ProteanCode
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant