we have a /resources/views/inc/navbar.blade.php that is used in our Laravel application main layout.
We installed a Wordpress app in the /public directory.
We need to be able to use the same navbar in our ourdomain.com/blog
Any ideas in how to this can be accomplished?
Just a brainstorming:
Ok. I think this same solution could be resolved with a regular web.php route as well
routes api.php
Route::get('/wp-menu',function() { return view('/wp-includes/wp-menu'); });
new view in /views/wp-includes/wp-menu.blade.php (I'm excluding the css and js)
@include('/inc.navbar')
Wordpress after the open body tag
on the footer before the closing body tag or you can find any of the jQuery js files
$(function() {
$('#navBarContainer').load('yourdomanin.com/api/wp-navbar');
});
And that worked, we now have the same navbar working inside our Laravel project and our wordpress, one thing to note is that is will only work in the same domain