M
M
Mykola Ivashchuk2019-01-16 22:46:54
Laravel
Mykola Ivashchuk, 2019-01-16 22:46:54

How to use WordPress DB for Laravel?

It is necessary to implement the REST API on larvell with a wordpress database.
I saw such a solution https://github.com/corcel/corcel - but I didn't really like it.
So far I see the use of SQL Views to create the necessary tables for Laravel models. In principle, everything should work, but the question arises - is it a good idea to use View in which there will be a request to form from several tables in terms of speed?
Or is it worth abstracting from the database and making a layer of repositories?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alex Wells, 2019-01-17
@mykolaim

If you are migrating from VP to Eloquent/Doctrine, then remake the base for yourself. Write php scripts in which you will create a new one from the old database until everything works out as it should. Then you can safely delete the old database, and do the same with production.
If you need to support both this and that, then there are only repositories. It is not clear what will change in the VP in the future, but in this case, Eloquent itself is not the best solution, it's better to map the doctrine. If you need to quickly and crutch, then it will also work with your corcel.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question