3

Suppose you want to add custom database support in Laravel 5. Whether it is MongoDB, Oracle or sqlite mod (SQLCipher). How would you go about it?

What I'm looking for is proper, elegant solution. Without core-hacking, which is easy to do, but would force you to manually analyze the codebase and rewrite it on every Laravel update.

Background

Actually, got this question trying to implement sqlcipher support in Laravel. Analyzed alternative crypto solutions, found no good enough way to manage MySQL or Postgre keys, so decided to go with encrypted sqlite. In fact, one might probably copy sqlite routine and just change the lib + add key request, but as I said before, I don't want to hack the core. It's just plain wrong.

Svyatoslav
  • 121
  • 1
  • 5
  • 1
    If there's PDO support for the DB you want to use you can probably do https://stackoverflow.com/questions/30916271/can-i-integrate-a-custom-pdo-wrapper-in-laravel Mongo is different because it's NoSQL – apokryfos Jun 03 '17 at 17:56
  • This actually a great guide, for hacking core, and in the end, I'll probably be forced to use it - thank you, @apokryfos! :) Although, what I was really hoping for is some way of adding custom PDO without hacking the code. Maybe it's silly, since if Laravel upgrades, you HAVE to revise the whole code, still I'd prefer some way to just attach custom PDO without interfering with core files. Guess it should be a feature request. – Svyatoslav Jun 17 '17 at 00:19

0 Answers0