ekandreas / bladerunner

WordPress plugin for Laravel Blade templating DEPRECATED
http://bladerunner.elseif.se
12 stars 1 forks source link

Using a laravel database when wordpress is a subfolder #41

Closed ghost closed 7 years ago

ghost commented 7 years ago

Is there anyway to use the database from the main Laravel application when Wordpress is installed in a subfolder?

i.e., $users = DB::table('users')->get();

My structure is like this:

-Laravel ---main app folders ---public -----blog -------wp-content --------plugins ----------bladerunner

ekandreas commented 7 years ago

Then you need WP to run inside a Laravel context. You can always force a facade with DB inside WP to catch up the settings from Laravel and run them in that context. I have tried something similar but more of catching the WP-database with Eloquent.